This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
A patch for features.h
- To: drepper@cygnus.com (Ulrich Drepper)
- Subject: A patch for features.h
- From: hjl@lucon.org (H.J. Lu)
- Date: Sat, 24 Oct 1998 17:45:14 -0700 (PDT)
- Cc: libc-hacker@cygnus.com (GNU C Library)
Hi,
Here is a VSX-PCT patch for include/features.h. The problem is we
cannot use _POSIX_C_SOURCE for POSIX.2 nor POSIX.4. So I added
_POSIX2_SOURCE and _POSIX4_SOURCE.
--
H.J. Lu (hjl@gnu.org)
---
Sat Oct 24 17:42:25 1998 H.J. Lu <hjl@gnu.org>
* include/features.h (_POSIX2_SOURCE): New.
(_POSIX4_SOURCE): New.
(_POSIX_C_SOURCE): Support IEEE Std 1003.1-1996.
Index: include/features.h
===================================================================
RCS file: /home/work/cvs/gnu/glibc/include/features.h,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 features.h
--- features.h 1998/08/20 16:05:47 1.1.1.5
+++ features.h 1998/10/23 20:22:57
@@ -25,8 +25,11 @@
__STRICT_ANSI__ ISO Standard C.
_ISOC9X_SOURCE Extensions to ISO C 89 from ISO C 9x.
_POSIX_SOURCE IEEE Std 1003.1.
- _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
- if >=199309L, add IEEE Std 1003.1b-1993
+ _POSIX2_SOURCE IEEE Std 1003.2.
+ _POSIX4_SOURCE IEEE Std 1003.4.
+ _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=199309L, add
+ IEEE Std 1003.1b-1993; if >= 199506L, add
+ IEEE Std 1003.1-1996
_XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if
Single Unix conformance is wanted.
_XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
@@ -42,7 +45,7 @@
The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
If none of these are defined, the default is all but _GNU_SOURCE.
If more than one of these are defined, they accumulate.
- For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
+ For example __STRICT_ANSI__, _POSIX2_SOURCE and _POSIX_C_SOURCE
together give you ISO C, 1003.1, and 1003.2, but nothing else.
These are defined by this file and are used by the
@@ -51,6 +54,7 @@
__USE_ISOC9X Define ISO C 9X things.
__USE_POSIX Define IEEE Std 1003.1 things.
__USE_POSIX2 Define IEEE Std 1003.2 things.
+ __USE_POSIX4 Define IEEE Std 1003.4 things.
__USE_POSIX199309 Define IEEE Std 1003.1b things.
__USE_XOPEN Define XPG things.
__USE_XOPEN_EXTENDED Define X/Open Unix things.
@@ -80,6 +84,7 @@
#undef __USE_ISOC9X
#undef __USE_POSIX
#undef __USE_POSIX2
+#undef __USE_POSIX4
#undef __USE_POSIX199309
#undef __USE_XOPEN
#undef __USE_XOPEN_EXTENDED
@@ -107,7 +112,8 @@
/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
#if defined _BSD_SOURCE && \
- !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
+ !(defined _POSIX_SOURCE || defined _POSIX2_SOURCE || \
+ defined _POSIX4_SOURCE || defined _POSIX_C_SOURCE || \
defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
defined _GNU_SOURCE || defined _SVID_SOURCE)
# define __FAVOR_BSD 1
@@ -119,6 +125,10 @@
# define _ISOC9X_SOURCE 1
# undef _POSIX_SOURCE
# define _POSIX_SOURCE 1
+# undef _POSIX2_SOURCE
+# define _POSIX2_SOURCE 1
+# undef _POSIX4_SOURCE
+# define _POSIX4_SOURCE 1
# undef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 199506L
# undef _XOPEN_SOURCE
@@ -136,7 +146,8 @@
/* If nothing (other than _GNU_SOURCE) is defined,
define _BSD_SOURCE and _SVID_SOURCE. */
#if (!defined __STRICT_ANSI__ && !defined _ISOC9X_SOURCE && \
- !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
+ !defined _POSIX_SOURCE && !defined _POSIX2_SOURCE && \
+ !defined _POSIX4_SOURCE && !defined _POSIX_C_SOURCE && \
!defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
!defined _BSD_SOURCE && !defined _SVID_SOURCE)
# define _BSD_SOURCE 1
@@ -149,24 +160,31 @@
# define __USE_ISOC9X 1
#endif
-/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
- (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */
+/* If none of the ANSI/POSIX macros are defined, use POSIX.1, POSIX.2
+ and POSIX.4 (and IEEE Std 1003.1-1996 unless _XOPEN_SOURCE is
+ defined). */
#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
- !defined _POSIX_C_SOURCE)
-# define _POSIX_SOURCE 1
-# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) != 500
-# define _POSIX_C_SOURCE 2
-# else
+ !defined _POSIX_C_SOURCE && !defined _POSIX2_SOURCE && \
+ !defined _POSIX4_SOURCE)
+# define _POSIX4_SOURCE 1
+# if !defined _XOPEN_SOURCE || (_XOPEN_SOURCE - 0) == 500
# define _POSIX_C_SOURCE 199506L
# endif
#endif
-#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE
+#if defined _POSIX_SOURCE || defined _POSIX2_SOURCE || \
+ defined _POSIX4_SOURCE || _POSIX_C_SOURCE >= 1 || \
+ defined _XOPEN_SOURCE
# define __USE_POSIX 1
#endif
-#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
+#if defined _POSIX2_SOURCE || defined _POSIX4_SOURCE || \
+ defined _XOPEN_SOURCE
# define __USE_POSIX2 1
+#endif
+
+#ifdef _POSIX4_SOURCE
+# define __USE_POSIX4 1
#endif
#if (_POSIX_C_SOURCE - 0) >= 199309L