From 13c89a620bf6811bc7ad253dacb67774986ab681 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 15 Aug 2024 17:40:06 +0200 Subject: [PATCH] features.h: support POSIX.1-2024 TBD: Align _GNU_SOURCE, too? Signed-off-by: Corinna Vinschen --- newlib/libc/include/sys/features.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index 41c1d0df2..43c029bf9 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -66,6 +66,9 @@ extern "C" { * _POSIX_C_SOURCE >= 200809L * POSIX.1-2008 * + * _POSIX_C_SOURCE >= 202405L + * POSIX.1-2024 + * * _XOPEN_SOURCE * POSIX.1-1990 and XPG4 * @@ -141,7 +144,7 @@ extern "C" { #undef _POSIX_SOURCE #define _POSIX_SOURCE 1 #undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200809L +#define _POSIX_C_SOURCE 202405L #endif #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \ @@ -194,6 +197,10 @@ extern "C" { * POSIX.1-2008; enabled by default, with _POSIX_C_SOURCE >= 200809L, * or _XOPEN_SOURCE >= 700. * + * __POSIX_VISIBLE >= 202405 + * POSIX.1-2024; enabled by default, with _POSIX_C_SOURCE >= 202405L, + * or _XOPEN_SOURCE >= 700. + * * __XSI_VISIBLE * XPG4 XSI extensions; enabled with any version of _XOPEN_SOURCE. * @@ -296,7 +303,9 @@ extern "C" { #define __MISC_VISIBLE 0 #endif -#if (_POSIX_C_SOURCE - 0) >= 200809L +#if (_POSIX_C_SOURCE - 0) >= 202405L +#define __POSIX_VISIBLE 202405 +#elif (_POSIX_C_SOURCE - 0) >= 200809L #define __POSIX_VISIBLE 200809 #elif (_POSIX_C_SOURCE - 0) >= 200112L #define __POSIX_VISIBLE 200112 @@ -422,7 +431,10 @@ extern "C" { #ifdef __CYGWIN__ -#if __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 202405 +#define _POSIX_VERSION 202405L +#define _POSIX2_VERSION 202405L +#elif __POSIX_VISIBLE >= 200809 #define _POSIX_VERSION 200809L #define _POSIX2_VERSION 200809L #elif __POSIX_VISIBLE >= 200112