ref: 14f673b333fcd3159c81aec06cc768cbcbece053
parent: 5910169188d1329c851a057159206dd3bd5a8987
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Feb 17 10:01:15 EST 2017
[libc] Add stddef.h
--- /dev/null
+++ b/libc/include/bits/amd64-sysv/arch/stddef.h
@@ -1,0 +1,20 @@
+/* See LICENSE file for copyright and license details. */
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+#ifndef _WCHAR_T
+typedef short wchar_t;
+#define _WCHAR_T
+#endif
+
+#ifndef _PTRDIFF_T
+typedef unsigned long ptrdiff_t;
+#define _PTRDIFF_T
+#endif
--- /dev/null
+++ b/libc/include/bits/i386-sysv/arch/stddef.h
@@ -1,0 +1,20 @@
+/* See LICENSE file for copyright and license details. */
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+#ifndef _WCHAR_T
+typedef short wchar_t;
+#define _WCHAR_T
+#endif
+
+#ifndef _PTRDIFF_T
+typedef unsigned long ptrdiff_t;
+#define _PTRDIFF_T
+#endif
--- /dev/null
+++ b/libc/include/bits/qbe/arch/stddef.h
@@ -1,0 +1,20 @@
+/* See LICENSE file for copyright and license details. */
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#ifndef _SIZET
+typedef unsigned long size_t;
+#define _SIZET
+#endif
+
+#ifndef _WCHAR_T
+typedef short wchar_t;
+#define _WCHAR_T
+#endif
+
+#ifndef _PTRDIFF_T
+typedef unsigned long ptrdiff_t;
+#define _PTRDIFF_T
+#endif
--- /dev/null
+++ b/libc/include/bits/z80/arch/stddef.h
@@ -1,0 +1,20 @@
+/* See LICENSE file for copyright and license details. */
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#ifndef _SIZET
+typedef unsigned short size_t;
+#define _SIZET
+#endif
+
+#ifndef _WCHAR_T
+typedef short wchar_t;
+#define _WCHAR_T
+#endif
+
+#ifndef _PTRDIFF_T
+typedef unsigned short ptrdiff_t;
+#define _PTRDIFF_T
+#endif
--- /dev/null
+++ b/libc/include/stddef.h
@@ -1,0 +1,9 @@
+/* See LICENSE file for copyright and license details. */
+#ifndef _STDDEF_H
+#define _STDDEF_H
+
+#include <arch/stddef.h>
+
+#define offsetof(st, m) ((size_t)&(((st *)0)->m))
+
+#endif