[hackers] [scc] [libc] Add stddef.h || Roberto E. Vargas Caballero
commit 59df0cfc947cf4203e64126881ab8d01f674f0aa
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Feb 17 15:01:15 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Feb 17 15:01:15 2017 +0100
[libc] Add stddef.h
diff --git a/libc/include/bits/amd64-sysv/arch/stddef.h b/libc/include/bits/amd64-sysv/arch/stddef.h
new file mode 100644
index 0000000..accfc74
--- /dev/null
+++ b/libc/include/bits/amd64-sysv/arch/stddef.h
_AT_@ -0,0 +1,19 @@
+
+#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
diff --git a/libc/include/bits/i386-sysv/arch/stddef.h b/libc/include/bits/i386-sysv/arch/stddef.h
new file mode 100644
index 0000000..accfc74
--- /dev/null
+++ b/libc/include/bits/i386-sysv/arch/stddef.h
_AT_@ -0,0 +1,19 @@
+
+#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
diff --git a/libc/include/bits/qbe/arch/stddef.h b/libc/include/bits/qbe/arch/stddef.h
new file mode 100644
index 0000000..accfc74
--- /dev/null
+++ b/libc/include/bits/qbe/arch/stddef.h
_AT_@ -0,0 +1,19 @@
+
+#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
diff --git a/libc/include/bits/z80/arch/stddef.h b/libc/include/bits/z80/arch/stddef.h
new file mode 100644
index 0000000..35f9f15
--- /dev/null
+++ b/libc/include/bits/z80/arch/stddef.h
_AT_@ -0,0 +1,19 @@
+
+#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
diff --git a/libc/include/stddef.h b/libc/include/stddef.h
new file mode 100644
index 0000000..e35309c
--- /dev/null
+++ b/libc/include/stddef.h
_AT_@ -0,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
Received on Fri Feb 17 2017 - 15:01:34 CET
This archive was generated by hypermail 2.3.0
: Fri Feb 17 2017 - 15:12:26 CET