summaryrefslogtreecommitdiff
path: root/src/include/stddef.h
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2012-12-07 17:24:06 -0800
committerRonald G. Minnich <rminnich@gmail.com>2012-12-08 06:54:16 +0100
commitda1ef02e904536446f0fb06f024ac1faede39d10 (patch)
tree0067b1ff7f7cb249b396c9b0e75dd3e1ad83811b /src/include/stddef.h
parent52db0b984523047da19ca3b41558b9dbf45abad7 (diff)
downloadcoreboot-da1ef02e904536446f0fb06f024ac1faede39d10.tar.xz
stddef.h: move to generic code
stddef.h should be fairly generic across all platforms we'd want to support, so let's move it to generic code. Change-Id: I580c9c9b54f62fadd9ea97115933e16ea0b13ada Signed-off-by: David Hendricks <dhendrix@chromium.org> Signed-off-by: Stefan Reinauer <reinauer@google.com> Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/2007 Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/include/stddef.h')
-rw-r--r--src/include/stddef.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/stddef.h b/src/include/stddef.h
new file mode 100644
index 0000000000..888d497809
--- /dev/null
+++ b/src/include/stddef.h
@@ -0,0 +1,24 @@
+#ifndef STDDEF_H
+#define STDDEF_H
+
+typedef long ptrdiff_t;
+#ifndef __SIZE_TYPE__
+#define __SIZE_TYPE__ unsigned long
+#endif
+typedef __SIZE_TYPE__ size_t;
+typedef long ssize_t;
+
+typedef int wchar_t;
+typedef unsigned int wint_t;
+
+#define NULL ((void *)0)
+
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+
+#ifdef __PRE_RAM__
+#define ROMSTAGE_CONST const
+#else
+#define ROMSTAGE_CONST
+#endif
+
+#endif /* STDDEF_H */