aboutsummaryrefslogtreecommitdiff
path: root/features.h
diff options
context:
space:
mode:
Diffstat (limited to 'features.h')
-rw-r--r--features.h57
1 files changed, 39 insertions, 18 deletions
diff --git a/features.h b/features.h
index deacda1663..9b20512c51 100644
--- a/features.h
+++ b/features.h
@@ -1,20 +1,20 @@
/* Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#ifndef _FEATURES_H
@@ -26,6 +26,8 @@ Cambridge, MA 02139, USA. */
__STRICT_ANSI__ ANSI Standard C.
_POSIX_SOURCE IEEE Std 1003.1.
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if ==2 add IEEE Std 1003.2.
+ _XOPEN_SOURCE Includes POSIX and XPG things.
+ _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
_BSD_SOURCE ANSI, POSIX, and 4.3BSD things.
_SVID_SOURCE ANSI, POSIX, and SVID things.
_GNU_SOURCE All of the above, plus GNU extensions.
@@ -43,6 +45,8 @@ Cambridge, MA 02139, USA. */
__USE_POSIX Define IEEE Std 1003.1 things.
__USE_POSIX2 Define IEEE Std 1003.2 things.
+ __USE_XOPEN Define XPG things.
+ __USE_XOPEN_EXTENDED Define X/Open Unix things.
__USE_BSD Define 4.3BSD things.
__USE_SVID Define SVID things.
__USE_MISC Define things common to BSD and System V Unix.
@@ -62,6 +66,8 @@ Cambridge, MA 02139, USA. */
/* Undefine everything, so we get a clean slate. */
#undef __USE_POSIX
#undef __USE_POSIX2
+#undef __USE_XOPEN
+#undef __USE_XOPEN_EXTENDED
#undef __USE_BSD
#undef __USE_SVID
#undef __USE_MISC
@@ -71,7 +77,7 @@ Cambridge, MA 02139, USA. */
#undef __KERNEL_STRICT_NAMES
/* Suppress kernel-name space pollution unless user expressedly asks
- for it: */
+ for it. */
#ifndef _LOOSE_KERNEL_NAMES
# define __KERNEL_STRICT_NAMES
#endif
@@ -83,8 +89,9 @@ Cambridge, MA 02139, USA. */
/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
#if defined (_BSD_SOURCE) && \
!(defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) || \
+ defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_DEFINED) || \
defined (_GNU_SOURCE) || defined (_SVID_SOURCE))
-#define __FAVOR_BSD 1
+# define __FAVOR_BSD 1
#endif
/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
@@ -93,6 +100,10 @@ Cambridge, MA 02139, USA. */
#define _POSIX_SOURCE 1
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 2
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#undef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED 1
#undef _BSD_SOURCE
#define _BSD_SOURCE 1
#undef _SVID_SOURCE
@@ -102,7 +113,8 @@ Cambridge, MA 02139, USA. */
/* If nothing (other than _GNU_SOURCE) is defined,
define _BSD_SOURCE and _SVID_SOURCE. */
#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) && \
- !defined (_POSIX_C_SOURCE) && !defined (_BSD_SOURCE) && \
+ !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE) && \
+ !defined (_XOPEN_SOURCE_EXTENDED) && !defined (_BSD_SOURCE) && \
!defined (_SVID_SOURCE))
#define _BSD_SOURCE 1
#define _SVID_SOURCE 1
@@ -115,14 +127,23 @@ Cambridge, MA 02139, USA. */
#define _POSIX_C_SOURCE 2
#endif
-#if defined (_POSIX_SOURCE) || _POSIX_C_SOURCE >= 1
+#if (defined (_POSIX_SOURCE) || _POSIX_C_SOURCE >= 1 || \
+ defined (_XOPEN_SOURCE))
#define __USE_POSIX 1
#endif
-#if defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 2
+#if (defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 2 || \
+ defined (_XOPEN_SOURCE))
#define __USE_POSIX2 1
#endif
+#ifdef _XOPEN_SOURCE
+#define __USE_XOPEN 1
+#ifdef _XOPEN_SOURCE_EXTENDED
+#define __USE_XOPEN_EXTENDED 1
+#endif
+#endif
+
#if defined (_BSD_SOURCE) || defined (_SVID_SOURCE)
#define __USE_MISC 1
#endif