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:
authorCorinna Vinschen <corinna@vinschen.de>2010-03-17 20:13:00 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-03-17 20:13:00 +0300
commit5e74a46f2fa91a3fb71b85714cc1764481316c37 (patch)
tree190bb872dc4d7cba4c85319b423a99f40988a2dc
parenta24d322c7670120fb8ac90fe8f1e40574534b45d (diff)
* libc/include/sys/features.h: Allow for _XOPEN_SOURCE to have an
empty definition. Also add support for values of 500 or less.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/include/sys/features.h12
2 files changed, 14 insertions, 3 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index c52f7bb0b..0bacfd7db 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-17 Craig Howland <howland@LGSInnovations.com>
+
+ * libc/include/sys/features.h: Allow for _XOPEN_SOURCE to have an
+ empty definition. Also add support for values of 500 or less.
+
2010-03-09 Jeff Johnston <jjohnstn@redhat.com>
* libc/posix/telldir.c (dd_loccnt): Change start index to be 1
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