diff --git a/include/stddef.h b/include/stddef.h --- a/include/stddef.h +++ b/include/stddef.h @@ -32,6 +32,9 @@ #ifndef _STDDEF_H_ #define _STDDEF_H_ +#ifndef __STDC_VERSION_STDDEF_H__ +#define __STDC_VERSION_STDDEF_H__ 202311L + #include #include #include @@ -78,4 +81,10 @@ #endif #endif /* __EXT1_VISIBLE */ +#if __STDC_VERSION__ >= 202311L +#define unreachable() __unreachable() +#endif + +#endif /* __STDC_VERSION_STDDEF_H__ */ + #endif /* _STDDEF_H_ */ diff --git a/sys/sys/_null.h b/sys/sys/_null.h --- a/sys/sys/_null.h +++ b/sys/sys/_null.h @@ -29,7 +29,11 @@ #ifndef NULL #if !defined(__cplusplus) +#if __STDC_VERSION__ >= 202311L +#define NULL nullptr +#else /* __STDC_VERSION__ < 202311L */ #define NULL ((void *)0) +#endif /* __STDC_VERSION__ >= 202311L */ #else #if __cplusplus >= 201103L #define NULL nullptr @@ -44,4 +48,8 @@ #endif /* __GNUG__ */ #endif /* !__cplusplus */ +#if __STDC_VERSION__ >= 202311L +typedef typeof_unqual(nullptr) nullptr_t; +#endif + #endif