diff --git a/include/assert.h b/include/assert.h index d474169719c6..06e771d24cf5 100644 --- a/include/assert.h +++ b/include/assert.h @@ -71,7 +71,9 @@ #ifndef _ASSERT_H_ #define _ASSERT_H_ +#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE #define __STDC_VERSION_ASSERT_H__ 202311L +#endif /* * Static assertions. In principle we could define static_assert for diff --git a/include/limits.h b/include/limits.h index 5e7e0317d42e..0ab58086cd2a 100644 --- a/include/limits.h +++ b/include/limits.h @@ -32,10 +32,12 @@ #ifndef _LIMITS_H_ #define _LIMITS_H_ -#define __STDC_VERSION_LIMITS_H__ 202311L - #include +#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE +#define __STDC_VERSION_LIMITS_H__ 202311L +#endif + #if __POSIX_VISIBLE #define _POSIX_ARG_MAX 4096 #define _POSIX_LINK_MAX 8 diff --git a/include/setjmp.h b/include/setjmp.h index 108b47771160..45a3beeec6ec 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -37,10 +37,12 @@ #ifndef _SETJMP_H_ #define _SETJMP_H_ -#define __STDC_VERSION_SETJMP_H__ 202311L - #include +#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE +#define __STDC_VERSION_SETJMP_H__ 202311L +#endif + /* The size of the jmp_buf is machine dependent: */ #include diff --git a/include/stdio.h b/include/stdio.h index 566dddb76925..1c7b0b3d0e8b 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -35,12 +35,14 @@ #ifndef _STDIO_H_ #define _STDIO_H_ -#define __STDC_VERSION_STDIO_H__ 202311L - #include #include #include +#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE +#define __STDC_VERSION_STDIO_H__ 202311L +#endif + __NULLABILITY_PRAGMA_PUSH typedef __off_t fpos_t; diff --git a/include/time.h b/include/time.h index fed2805e03f1..6b304b6dd03b 100644 --- a/include/time.h +++ b/include/time.h @@ -37,13 +37,15 @@ #ifndef _TIME_H_ #define _TIME_H_ -#define __STDC_VERSION_TIME_H__ 202311L - #include #include #include #include +#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE +#define __STDC_VERSION_TIME_H__ 202311L +#endif + #if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE /* * Frequency of the clock ticks reported by times(). Deprecated - use diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index cc1e31f658a4..e57fe3538bea 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -30,11 +30,13 @@ #ifndef _STDATOMIC_H_ #define _STDATOMIC_H_ -#define __STDC_VERSION_STDATOMIC_H__ 202311L - #include #include +#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE +#define __STDC_VERSION_STDATOMIC_H__ 202311L +#endif + #if (__has_extension(c_atomic) || __has_extension(cxx_atomic)) && \ defined(__clang__) #define __CLANG_ATOMICS