blob: 2705dac416dfe20e4d1f50f5b91547a074c9ba79 [file] [log] [blame]
Kevin O'Connorf076a3e2008-02-25 22:25:15 -05001// Basic type definitions for X86 cpus.
2//
3// Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
4//
5// This file may be distributed under the terms of the GNU GPLv3 license.
6#ifndef __TYPES_H
7#define __TYPES_H
8
9typedef unsigned char u8;
10typedef signed char s8;
11typedef unsigned short u16;
12typedef signed short s16;
13typedef unsigned int u32;
14typedef signed int s32;
15typedef u32 size_t;
16
17#define VISIBLE __attribute__((externally_visible))
18
19#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
Kevin O'Connor38fcbfe2008-02-25 22:30:47 -050020#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
21
22#define NULL ((void *)0)
Kevin O'Connorf076a3e2008-02-25 22:25:15 -050023
24#endif // types.h