From 0730de4b2af0254849288be4679b3cbdcad31e3d Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 15 Mar 2024 01:48:40 -0400 Subject: libc: stddef: Handle NULL for C++ Signed-off-by: Ian Moffett --- lib/libc/include/stddef.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/libc/include') 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 */ -- cgit v1.2.3