From c60b8d70680695959d9028bcac11af5a1f584279 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Tue, 25 Apr 2023 21:36:04 +0200 Subject: [PATCH] Misc updates to stddef.h to improve resiliency --- stddef.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stddef.h b/stddef.h index d5fb84b..0fea5c1 100644 --- a/stddef.h +++ b/stddef.h @@ -23,20 +23,19 @@ typedef decltype(nullptr) nullptr_t; #ifndef __FSTD_HDRS_STDDEF_H_MACROS #define __FSTD_HDRS_STDDEF_H_MACROS 1 -#ifdef NULL #undef NULL -#endif - #ifndef __cplusplus # define NULL ((void *)0) #else # define NULL 0 #endif +#undef offsetof #define offsetof(s, m) __builtin_offsetof(s, m) /* XXX fix to use proper __STDC_VERSION__ number later on */ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L) +# undef unreachable # define unreachable() __builtin_unreachable() #endif