Stefan Reinauer | da1ef02 | 2012-12-07 17:24:06 -0800 | [diff] [blame] | 1 | #ifndef STDDEF_H |
| 2 | #define STDDEF_H |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 3 | |
| 4 | typedef long ptrdiff_t; |
Stefan Reinauer | 0e740d3 | 2012-05-14 13:21:08 -0700 | [diff] [blame] | 5 | #ifndef __SIZE_TYPE__ |
| 6 | #define __SIZE_TYPE__ unsigned long |
| 7 | #endif |
| 8 | typedef __SIZE_TYPE__ size_t; |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 9 | typedef long ssize_t; |
| 10 | |
| 11 | typedef int wchar_t; |
| 12 | typedef unsigned int wint_t; |
| 13 | |
Eric Biederman | b78c197 | 2004-10-14 20:54:17 +0000 | [diff] [blame] | 14 | #define NULL ((void *)0) |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 15 | |
Ronald G. Minnich | aa3f428 | 2013-03-15 20:17:26 -0700 | [diff] [blame] | 16 | /* Standard units. */ |
| 17 | #define KiB (1<<10) |
| 18 | #define MiB (1<<20) |
| 19 | #define GiB (1<<30) |
| 20 | /* Could we ever run into this one? I hope we get this much memory! */ |
| 21 | #define TiB (1<<40) |
| 22 | |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 23 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
| 24 | |
Stefan Reinauer | 57879c9 | 2012-07-31 16:47:25 -0700 | [diff] [blame] | 25 | #ifdef __PRE_RAM__ |
| 26 | #define ROMSTAGE_CONST const |
| 27 | #else |
| 28 | #define ROMSTAGE_CONST |
| 29 | #endif |
| 30 | |
Stefan Reinauer | da1ef02 | 2012-12-07 17:24:06 -0800 | [diff] [blame] | 31 | #endif /* STDDEF_H */ |