Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/include/sys/features.h')
-rw-r--r--newlib/libc/include/sys/features.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h
index e7968e05a..0277fb0a5 100644
--- a/newlib/libc/include/sys/features.h
+++ b/newlib/libc/include/sys/features.h
@@ -183,13 +183,19 @@ extern "C" {
/* 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.
+ * This permission is first granted in 2008, but use it for older ones, also.
+ * Allow for _XOPEN_SOURCE to be empty (from the earliest form of it, before it
+ * was required to have specific values).
*/
#if !defined(_POSIX_C_SOURCE) && defined(_XOPEN_SOURCE)
- #if _XOPEN_SOURCE == 700 /* POSIX.1-2008 */
+ #if (_XOPEN_SOURCE - 0) == 700 /* POSIX.1-2008 */
#define _POSIX_C_SOURCE 200809L
- #elif _XOPEN_SOURCE == 600 /* POSIX.1-2001 */
+ #elif (_XOPEN_SOURCE - 0) == 600 /* POSIX.1-2001 or 2004 */
#define _POSIX_C_SOURCE 200112L
+ #elif (_XOPEN_SOURCE - 0) == 500 /* POSIX.1-1995 */
+ #define _POSIX_C_SOURCE 199506L
+ #elif (_XOPEN_SOURCE - 0) < 500 /* really old */
+ #define _POSIX_C_SOURCE 2
#endif
#endif