mirror of
https://github.com/mintsuki/freestanding-headers
synced 2024-11-25 13:59:43 +03:00
Misc updates to stddef.h to improve resiliency
This commit is contained in:
parent
7d5edad571
commit
c60b8d7068
5
stddef.h
5
stddef.h
@ -23,20 +23,19 @@ typedef decltype(nullptr) nullptr_t;
|
|||||||
#ifndef __FSTD_HDRS_STDDEF_H_MACROS
|
#ifndef __FSTD_HDRS_STDDEF_H_MACROS
|
||||||
#define __FSTD_HDRS_STDDEF_H_MACROS 1
|
#define __FSTD_HDRS_STDDEF_H_MACROS 1
|
||||||
|
|
||||||
#ifdef NULL
|
|
||||||
#undef NULL
|
#undef NULL
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
# define NULL ((void *)0)
|
# define NULL ((void *)0)
|
||||||
#else
|
#else
|
||||||
# define NULL 0
|
# define NULL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef offsetof
|
||||||
#define offsetof(s, m) __builtin_offsetof(s, m)
|
#define offsetof(s, m) __builtin_offsetof(s, m)
|
||||||
|
|
||||||
/* XXX fix to use proper __STDC_VERSION__ number later on */
|
/* XXX fix to use proper __STDC_VERSION__ number later on */
|
||||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
|
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
|
||||||
|
# undef unreachable
|
||||||
# define unreachable() __builtin_unreachable()
|
# define unreachable() __builtin_unreachable()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user