summaryrefslogtreecommitdiff
path: root/include/stddef.h
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-07 20:10:31 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-07 20:10:31 +0100
commitfc00c656c96528112d05cf0edf8631bd5eaea446 (patch)
treea6e0e6c588191a8bd1c64afc3b7a258e3e66c236 /include/stddef.h
Add build system scaffolding and libc headers
Diffstat (limited to 'include/stddef.h')
-rw-r--r--include/stddef.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/stddef.h b/include/stddef.h
new file mode 100644
index 00000000..bb8d1925
--- /dev/null
+++ b/include/stddef.h
@@ -0,0 +1,24 @@
+#ifndef __STDDEF_H
+#define __STDDEF_H
+
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+#if __STDC_VERSION__ >= 202311L
+typedef typeof(nullptr) nullptr_t;
+#else
+typedef void *nullptr_t;
+#define nullptr ((void *)0)
+#endif
+
+#ifndef offsetof
+#define offsetof(__type, __member) __builtin_offsetof(__type, __member)
+#endif
+
+typedef __WCHAR_TYPE__ wchar_t;
+typedef __SIZE_TYPE__ ptrdiff_t;
+typedef __SIZE_TYPE__ size_t;
+typedef __INT32_TYPE__ max_align_t;
+
+#endif