summaryrefslogtreecommitdiff
path: root/lib/libc/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-15 01:48:40 -0400
committerIan Moffett <ian@osmora.org>2024-03-15 01:48:40 -0400
commit0730de4b2af0254849288be4679b3cbdcad31e3d (patch)
tree08f789b16b975310fe8eaaf8dc2e34dd24cdb539 /lib/libc/include
parent2970aed680d17d33647f4b5e86fb9353561e724a (diff)
libc: stddef: Handle NULL for C++
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/libc/include')
-rw-r--r--lib/libc/include/stddef.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/include/stddef.h b/lib/libc/include/stddef.h
index ba469c1..7f7eb43 100644
--- a/lib/libc/include/stddef.h
+++ b/lib/libc/include/stddef.h
@@ -30,6 +30,12 @@
#ifndef _STDDEF_H
#define _STDDEF_H
+#if __cplusplus >= 201103L
+#define NULL nullptr
+#elif defined(__cplusplus)
+#define NULL 0L
+#else
#define NULL ((void *) 0)
+#endif
#endif /* !_STDDEF_H */