diff options
Diffstat (limited to 'newlib/libc/include/sys/features.h')
-rw-r--r-- | newlib/libc/include/sys/features.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index bc40f0068..e7968e05a 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -180,6 +180,19 @@ extern "C" { #endif /* !__STRICT_ANSI__ || __cplusplus || __STDC_VERSION__ >= 199901L */ #endif /* __CYGWIN__ */ +/* Per the permission given in POSIX.1-2008 section 2.2.1, define + * _POSIX_C_SOURCE if _XOPEN_SOURCE is defined and _POSIX_C_SOURCE is not. + * (_XOPEN_SOURCE indicates that XSI extensions are desired by an application.) + * This permission is first granted in 2008, but it is used for 2001, anyway. + */ +#if !defined(_POSIX_C_SOURCE) && defined(_XOPEN_SOURCE) + #if _XOPEN_SOURCE == 700 /* POSIX.1-2008 */ + #define _POSIX_C_SOURCE 200809L + #elif _XOPEN_SOURCE == 600 /* POSIX.1-2001 */ + #define _POSIX_C_SOURCE 200112L + #endif +#endif + #ifdef __cplusplus } #endif |