[hackers] [scc] [libc] Add stddef.h || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 17 Feb 2017 15:03:01 +0100 (CET)

commit 7030f8afe36ad641a56f101660b6256ca81c5b6b
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:02:53 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..bd65fef
--- /dev/null
+++ b/libc/include/bits/amd64-sysv/arch/stddef.h
_AT_@ -0,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
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..bd65fef
--- /dev/null
+++ b/libc/include/bits/i386-sysv/arch/stddef.h
_AT_@ -0,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
diff --git a/libc/include/bits/qbe/arch/stddef.h b/libc/include/bits/qbe/arch/stddef.h
new file mode 100644
index 0000000..bd65fef
--- /dev/null
+++ b/libc/include/bits/qbe/arch/stddef.h
_AT_@ -0,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
diff --git a/libc/include/bits/z80/arch/stddef.h b/libc/include/bits/z80/arch/stddef.h
new file mode 100644
index 0000000..8195de4
--- /dev/null
+++ b/libc/include/bits/z80/arch/stddef.h
_AT_@ -0,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
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:03:01 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 17 2017 - 15:12:31 CET