1*53ee8cc1Swenshuai.xi /* Copyright (C) 1991,1992,1993,1995-2006,2007 Free Software Foundation, Inc. 2*53ee8cc1Swenshuai.xi This file is part of the GNU C Library. 3*53ee8cc1Swenshuai.xi 4*53ee8cc1Swenshuai.xi The GNU C Library is free software; you can redistribute it and/or 5*53ee8cc1Swenshuai.xi modify it under the terms of the GNU Lesser General Public 6*53ee8cc1Swenshuai.xi License as published by the Free Software Foundation; either 7*53ee8cc1Swenshuai.xi version 2.1 of the License, or (at your option) any later version. 8*53ee8cc1Swenshuai.xi 9*53ee8cc1Swenshuai.xi The GNU C Library is distributed in the hope that it will be useful, 10*53ee8cc1Swenshuai.xi but WITHOUT ANY WARRANTY; without even the implied warranty of 11*53ee8cc1Swenshuai.xi MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12*53ee8cc1Swenshuai.xi Lesser General Public License for more details. 13*53ee8cc1Swenshuai.xi 14*53ee8cc1Swenshuai.xi You should have received a copy of the GNU Lesser General Public 15*53ee8cc1Swenshuai.xi License along with the GNU C Library; if not, write to the Free 16*53ee8cc1Swenshuai.xi Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 17*53ee8cc1Swenshuai.xi 02111-1307 USA. */ 18*53ee8cc1Swenshuai.xi 19*53ee8cc1Swenshuai.xi #ifndef _FEATURES_H 20*53ee8cc1Swenshuai.xi #define _FEATURES_H 1 21*53ee8cc1Swenshuai.xi 22*53ee8cc1Swenshuai.xi /* These are defined by the user (or the compiler) 23*53ee8cc1Swenshuai.xi to specify the desired environment: 24*53ee8cc1Swenshuai.xi 25*53ee8cc1Swenshuai.xi __STRICT_ANSI__ ISO Standard C. 26*53ee8cc1Swenshuai.xi _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. 27*53ee8cc1Swenshuai.xi _POSIX_SOURCE IEEE Std 1003.1. 28*53ee8cc1Swenshuai.xi _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; 29*53ee8cc1Swenshuai.xi if >=199309L, add IEEE Std 1003.1b-1993; 30*53ee8cc1Swenshuai.xi if >=199506L, add IEEE Std 1003.1c-1995; 31*53ee8cc1Swenshuai.xi if >=200112L, all of IEEE 1003.1-2004 32*53ee8cc1Swenshuai.xi _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if 33*53ee8cc1Swenshuai.xi Single Unix conformance is wanted, to 600 for the 34*53ee8cc1Swenshuai.xi upcoming sixth revision. 35*53ee8cc1Swenshuai.xi _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. 36*53ee8cc1Swenshuai.xi _LARGEFILE_SOURCE Some more functions for correct standard I/O. 37*53ee8cc1Swenshuai.xi _LARGEFILE64_SOURCE Additional functionality from LFS for large files. 38*53ee8cc1Swenshuai.xi _FILE_OFFSET_BITS=N Select default filesystem interface. 39*53ee8cc1Swenshuai.xi _BSD_SOURCE ISO C, POSIX, and 4.3BSD things. 40*53ee8cc1Swenshuai.xi _SVID_SOURCE ISO C, POSIX, and SVID things. 41*53ee8cc1Swenshuai.xi _ATFILE_SOURCE Additional *at interfaces. 42*53ee8cc1Swenshuai.xi _GNU_SOURCE All of the above, plus GNU extensions. 43*53ee8cc1Swenshuai.xi _REENTRANT Select additionally reentrant object. 44*53ee8cc1Swenshuai.xi _THREAD_SAFE Same as _REENTRANT, often used by other systems. 45*53ee8cc1Swenshuai.xi _FORTIFY_SOURCE If set to numeric value > 0 additional security 46*53ee8cc1Swenshuai.xi measures are defined, according to level. 47*53ee8cc1Swenshuai.xi 48*53ee8cc1Swenshuai.xi The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__. 49*53ee8cc1Swenshuai.xi If none of these are defined, the default is to have _SVID_SOURCE, 50*53ee8cc1Swenshuai.xi _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to 51*53ee8cc1Swenshuai.xi 200112L. If more than one of these are defined, they accumulate. 52*53ee8cc1Swenshuai.xi For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE 53*53ee8cc1Swenshuai.xi together give you ISO C, 1003.1, and 1003.2, but nothing else. 54*53ee8cc1Swenshuai.xi 55*53ee8cc1Swenshuai.xi These are defined by this file and are used by the 56*53ee8cc1Swenshuai.xi header files to decide what to declare or define: 57*53ee8cc1Swenshuai.xi 58*53ee8cc1Swenshuai.xi __USE_ISOC99 Define ISO C99 things. 59*53ee8cc1Swenshuai.xi __USE_ISOC95 Define ISO C90 AMD1 (C95) things. 60*53ee8cc1Swenshuai.xi __USE_POSIX Define IEEE Std 1003.1 things. 61*53ee8cc1Swenshuai.xi __USE_POSIX2 Define IEEE Std 1003.2 things. 62*53ee8cc1Swenshuai.xi __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. 63*53ee8cc1Swenshuai.xi __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. 64*53ee8cc1Swenshuai.xi __USE_XOPEN Define XPG things. 65*53ee8cc1Swenshuai.xi __USE_XOPEN_EXTENDED Define X/Open Unix things. 66*53ee8cc1Swenshuai.xi __USE_UNIX98 Define Single Unix V2 things. 67*53ee8cc1Swenshuai.xi __USE_XOPEN2K Define XPG6 things. 68*53ee8cc1Swenshuai.xi __USE_LARGEFILE Define correct standard I/O things. 69*53ee8cc1Swenshuai.xi __USE_LARGEFILE64 Define LFS things with separate names. 70*53ee8cc1Swenshuai.xi __USE_FILE_OFFSET64 Define 64bit interface as default. 71*53ee8cc1Swenshuai.xi __USE_BSD Define 4.3BSD things. 72*53ee8cc1Swenshuai.xi __USE_SVID Define SVID things. 73*53ee8cc1Swenshuai.xi __USE_MISC Define things common to BSD and System V Unix. 74*53ee8cc1Swenshuai.xi __USE_ATFILE Define *at interfaces and AT_* constants for them. 75*53ee8cc1Swenshuai.xi __USE_GNU Define GNU extensions. 76*53ee8cc1Swenshuai.xi __USE_REENTRANT Define reentrant/thread-safe *_r functions. 77*53ee8cc1Swenshuai.xi __USE_FORTIFY_LEVEL Additional security measures used, according to level. 78*53ee8cc1Swenshuai.xi __FAVOR_BSD Favor 4.3BSD things in cases of conflict. 79*53ee8cc1Swenshuai.xi 80*53ee8cc1Swenshuai.xi The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are 81*53ee8cc1Swenshuai.xi defined by this file unconditionally. `__GNU_LIBRARY__' is provided 82*53ee8cc1Swenshuai.xi only for compatibility. All new code should use the other symbols 83*53ee8cc1Swenshuai.xi to test for features. 84*53ee8cc1Swenshuai.xi 85*53ee8cc1Swenshuai.xi All macros listed above as possibly being defined by this file are 86*53ee8cc1Swenshuai.xi explicitly undefined if they are not explicitly defined. 87*53ee8cc1Swenshuai.xi Feature-test macros that are not defined by the user or compiler 88*53ee8cc1Swenshuai.xi but are implied by the other feature-test macros defined (or by the 89*53ee8cc1Swenshuai.xi lack of any definitions) are defined by the file. */ 90*53ee8cc1Swenshuai.xi 91*53ee8cc1Swenshuai.xi 92*53ee8cc1Swenshuai.xi /* Undefine everything, so we get a clean slate. */ 93*53ee8cc1Swenshuai.xi #undef __USE_ISOC99 94*53ee8cc1Swenshuai.xi #undef __USE_ISOC95 95*53ee8cc1Swenshuai.xi #undef __USE_POSIX 96*53ee8cc1Swenshuai.xi #undef __USE_POSIX2 97*53ee8cc1Swenshuai.xi #undef __USE_POSIX199309 98*53ee8cc1Swenshuai.xi #undef __USE_POSIX199506 99*53ee8cc1Swenshuai.xi #undef __USE_XOPEN 100*53ee8cc1Swenshuai.xi #undef __USE_XOPEN_EXTENDED 101*53ee8cc1Swenshuai.xi #undef __USE_UNIX98 102*53ee8cc1Swenshuai.xi #undef __USE_XOPEN2K 103*53ee8cc1Swenshuai.xi #undef __USE_LARGEFILE 104*53ee8cc1Swenshuai.xi #undef __USE_LARGEFILE64 105*53ee8cc1Swenshuai.xi #undef __USE_FILE_OFFSET64 106*53ee8cc1Swenshuai.xi #undef __USE_BSD 107*53ee8cc1Swenshuai.xi #undef __USE_SVID 108*53ee8cc1Swenshuai.xi #undef __USE_MISC 109*53ee8cc1Swenshuai.xi #undef __USE_ATFILE 110*53ee8cc1Swenshuai.xi #undef __USE_GNU 111*53ee8cc1Swenshuai.xi #undef __USE_REENTRANT 112*53ee8cc1Swenshuai.xi #undef __USE_FORTIFY_LEVEL 113*53ee8cc1Swenshuai.xi #undef __FAVOR_BSD 114*53ee8cc1Swenshuai.xi #undef __KERNEL_STRICT_NAMES 115*53ee8cc1Swenshuai.xi 116*53ee8cc1Swenshuai.xi /* Suppress kernel-name space pollution unless user expressedly asks 117*53ee8cc1Swenshuai.xi for it. */ 118*53ee8cc1Swenshuai.xi #ifndef _LOOSE_KERNEL_NAMES 119*53ee8cc1Swenshuai.xi # define __KERNEL_STRICT_NAMES 120*53ee8cc1Swenshuai.xi #endif 121*53ee8cc1Swenshuai.xi 122*53ee8cc1Swenshuai.xi /* Always use ISO C things. */ 123*53ee8cc1Swenshuai.xi #define __USE_ANSI 1 124*53ee8cc1Swenshuai.xi 125*53ee8cc1Swenshuai.xi /* Convenience macros to test the versions of glibc and gcc. 126*53ee8cc1Swenshuai.xi Use them like this: 127*53ee8cc1Swenshuai.xi #if __GNUC_PREREQ (2,8) 128*53ee8cc1Swenshuai.xi ... code requiring gcc 2.8 or later ... 129*53ee8cc1Swenshuai.xi #endif 130*53ee8cc1Swenshuai.xi Note - they won't work for gcc1 or glibc1, since the _MINOR macros 131*53ee8cc1Swenshuai.xi were not defined then. */ 132*53ee8cc1Swenshuai.xi #if defined __GNUC__ && defined __GNUC_MINOR__ 133*53ee8cc1Swenshuai.xi # define __GNUC_PREREQ(maj, min) \ 134*53ee8cc1Swenshuai.xi ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) 135*53ee8cc1Swenshuai.xi #else 136*53ee8cc1Swenshuai.xi # define __GNUC_PREREQ(maj, min) 0 137*53ee8cc1Swenshuai.xi #endif 138*53ee8cc1Swenshuai.xi 139*53ee8cc1Swenshuai.xi 140*53ee8cc1Swenshuai.xi /* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */ 141*53ee8cc1Swenshuai.xi #if defined _BSD_SOURCE && \ 142*53ee8cc1Swenshuai.xi !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \ 143*53ee8cc1Swenshuai.xi defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \ 144*53ee8cc1Swenshuai.xi defined _GNU_SOURCE || defined _SVID_SOURCE) 145*53ee8cc1Swenshuai.xi # define __FAVOR_BSD 1 146*53ee8cc1Swenshuai.xi #endif 147*53ee8cc1Swenshuai.xi 148*53ee8cc1Swenshuai.xi /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ 149*53ee8cc1Swenshuai.xi #ifdef _GNU_SOURCE 150*53ee8cc1Swenshuai.xi # undef _ISOC99_SOURCE 151*53ee8cc1Swenshuai.xi # define _ISOC99_SOURCE 1 152*53ee8cc1Swenshuai.xi # undef _POSIX_SOURCE 153*53ee8cc1Swenshuai.xi # define _POSIX_SOURCE 1 154*53ee8cc1Swenshuai.xi # undef _POSIX_C_SOURCE 155*53ee8cc1Swenshuai.xi # define _POSIX_C_SOURCE 200112L 156*53ee8cc1Swenshuai.xi # undef _XOPEN_SOURCE 157*53ee8cc1Swenshuai.xi # define _XOPEN_SOURCE 600 158*53ee8cc1Swenshuai.xi # undef _XOPEN_SOURCE_EXTENDED 159*53ee8cc1Swenshuai.xi # define _XOPEN_SOURCE_EXTENDED 1 160*53ee8cc1Swenshuai.xi # undef _LARGEFILE64_SOURCE 161*53ee8cc1Swenshuai.xi # define _LARGEFILE64_SOURCE 1 162*53ee8cc1Swenshuai.xi # undef _BSD_SOURCE 163*53ee8cc1Swenshuai.xi # define _BSD_SOURCE 1 164*53ee8cc1Swenshuai.xi # undef _SVID_SOURCE 165*53ee8cc1Swenshuai.xi # define _SVID_SOURCE 1 166*53ee8cc1Swenshuai.xi # undef _ATFILE_SOURCE 167*53ee8cc1Swenshuai.xi # define _ATFILE_SOURCE 1 168*53ee8cc1Swenshuai.xi #endif 169*53ee8cc1Swenshuai.xi 170*53ee8cc1Swenshuai.xi /* If nothing (other than _GNU_SOURCE) is defined, 171*53ee8cc1Swenshuai.xi define _BSD_SOURCE and _SVID_SOURCE. */ 172*53ee8cc1Swenshuai.xi #if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \ 173*53ee8cc1Swenshuai.xi !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \ 174*53ee8cc1Swenshuai.xi !defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \ 175*53ee8cc1Swenshuai.xi !defined _BSD_SOURCE && !defined _SVID_SOURCE) 176*53ee8cc1Swenshuai.xi # define _BSD_SOURCE 1 177*53ee8cc1Swenshuai.xi # define _SVID_SOURCE 1 178*53ee8cc1Swenshuai.xi #endif 179*53ee8cc1Swenshuai.xi 180*53ee8cc1Swenshuai.xi /* This is to enable the ISO C99 extension. Also recognize the old macro 181*53ee8cc1Swenshuai.xi which was used prior to the standard acceptance. This macro will 182*53ee8cc1Swenshuai.xi eventually go away and the features enabled by default once the ISO C99 183*53ee8cc1Swenshuai.xi standard is widely adopted. */ 184*53ee8cc1Swenshuai.xi #if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \ 185*53ee8cc1Swenshuai.xi || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) 186*53ee8cc1Swenshuai.xi # define __USE_ISOC99 1 187*53ee8cc1Swenshuai.xi #endif 188*53ee8cc1Swenshuai.xi 189*53ee8cc1Swenshuai.xi /* This is to enable the ISO C90 Amendment 1:1995 extension. */ 190*53ee8cc1Swenshuai.xi #if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \ 191*53ee8cc1Swenshuai.xi || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) 192*53ee8cc1Swenshuai.xi # define __USE_ISOC95 1 193*53ee8cc1Swenshuai.xi #endif 194*53ee8cc1Swenshuai.xi 195*53ee8cc1Swenshuai.xi /* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2 196*53ee8cc1Swenshuai.xi (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */ 197*53ee8cc1Swenshuai.xi #if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \ 198*53ee8cc1Swenshuai.xi !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE) 199*53ee8cc1Swenshuai.xi # define _POSIX_SOURCE 1 200*53ee8cc1Swenshuai.xi # if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 201*53ee8cc1Swenshuai.xi # define _POSIX_C_SOURCE 2 202*53ee8cc1Swenshuai.xi # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600 203*53ee8cc1Swenshuai.xi # define _POSIX_C_SOURCE 199506L 204*53ee8cc1Swenshuai.xi # else 205*53ee8cc1Swenshuai.xi # define _POSIX_C_SOURCE 200112L 206*53ee8cc1Swenshuai.xi # endif 207*53ee8cc1Swenshuai.xi #endif 208*53ee8cc1Swenshuai.xi 209*53ee8cc1Swenshuai.xi #if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE 210*53ee8cc1Swenshuai.xi # define __USE_POSIX 1 211*53ee8cc1Swenshuai.xi #endif 212*53ee8cc1Swenshuai.xi 213*53ee8cc1Swenshuai.xi #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE 214*53ee8cc1Swenshuai.xi # define __USE_POSIX2 1 215*53ee8cc1Swenshuai.xi #endif 216*53ee8cc1Swenshuai.xi 217*53ee8cc1Swenshuai.xi #if (_POSIX_C_SOURCE - 0) >= 199309L 218*53ee8cc1Swenshuai.xi # define __USE_POSIX199309 1 219*53ee8cc1Swenshuai.xi #endif 220*53ee8cc1Swenshuai.xi 221*53ee8cc1Swenshuai.xi #if (_POSIX_C_SOURCE - 0) >= 199506L 222*53ee8cc1Swenshuai.xi # define __USE_POSIX199506 1 223*53ee8cc1Swenshuai.xi #endif 224*53ee8cc1Swenshuai.xi 225*53ee8cc1Swenshuai.xi #if (_POSIX_C_SOURCE - 0) >= 200112L 226*53ee8cc1Swenshuai.xi # define __USE_XOPEN2K 1 227*53ee8cc1Swenshuai.xi #endif 228*53ee8cc1Swenshuai.xi 229*53ee8cc1Swenshuai.xi #ifdef _XOPEN_SOURCE 230*53ee8cc1Swenshuai.xi # define __USE_XOPEN 1 231*53ee8cc1Swenshuai.xi # if (_XOPEN_SOURCE - 0) >= 500 232*53ee8cc1Swenshuai.xi # define __USE_XOPEN_EXTENDED 1 233*53ee8cc1Swenshuai.xi # define __USE_UNIX98 1 234*53ee8cc1Swenshuai.xi # undef _LARGEFILE_SOURCE 235*53ee8cc1Swenshuai.xi # define _LARGEFILE_SOURCE 1 236*53ee8cc1Swenshuai.xi # if (_XOPEN_SOURCE - 0) >= 600 237*53ee8cc1Swenshuai.xi # define __USE_XOPEN2K 1 238*53ee8cc1Swenshuai.xi # undef __USE_ISOC99 239*53ee8cc1Swenshuai.xi # define __USE_ISOC99 1 240*53ee8cc1Swenshuai.xi # endif 241*53ee8cc1Swenshuai.xi # else 242*53ee8cc1Swenshuai.xi # ifdef _XOPEN_SOURCE_EXTENDED 243*53ee8cc1Swenshuai.xi # define __USE_XOPEN_EXTENDED 1 244*53ee8cc1Swenshuai.xi # endif 245*53ee8cc1Swenshuai.xi # endif 246*53ee8cc1Swenshuai.xi #endif 247*53ee8cc1Swenshuai.xi 248*53ee8cc1Swenshuai.xi #ifdef _LARGEFILE_SOURCE 249*53ee8cc1Swenshuai.xi # define __USE_LARGEFILE 1 250*53ee8cc1Swenshuai.xi #endif 251*53ee8cc1Swenshuai.xi 252*53ee8cc1Swenshuai.xi #ifdef _LARGEFILE64_SOURCE 253*53ee8cc1Swenshuai.xi # define __USE_LARGEFILE64 1 254*53ee8cc1Swenshuai.xi #endif 255*53ee8cc1Swenshuai.xi 256*53ee8cc1Swenshuai.xi #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 257*53ee8cc1Swenshuai.xi # define __USE_FILE_OFFSET64 1 258*53ee8cc1Swenshuai.xi #endif 259*53ee8cc1Swenshuai.xi 260*53ee8cc1Swenshuai.xi #if defined _BSD_SOURCE || defined _SVID_SOURCE 261*53ee8cc1Swenshuai.xi # define __USE_MISC 1 262*53ee8cc1Swenshuai.xi #endif 263*53ee8cc1Swenshuai.xi 264*53ee8cc1Swenshuai.xi #ifdef _BSD_SOURCE 265*53ee8cc1Swenshuai.xi # define __USE_BSD 1 266*53ee8cc1Swenshuai.xi #endif 267*53ee8cc1Swenshuai.xi 268*53ee8cc1Swenshuai.xi #ifdef _SVID_SOURCE 269*53ee8cc1Swenshuai.xi # define __USE_SVID 1 270*53ee8cc1Swenshuai.xi #endif 271*53ee8cc1Swenshuai.xi 272*53ee8cc1Swenshuai.xi #ifdef _ATFILE_SOURCE 273*53ee8cc1Swenshuai.xi # define __USE_ATFILE 1 274*53ee8cc1Swenshuai.xi #endif 275*53ee8cc1Swenshuai.xi 276*53ee8cc1Swenshuai.xi #ifdef _GNU_SOURCE 277*53ee8cc1Swenshuai.xi # define __USE_GNU 1 278*53ee8cc1Swenshuai.xi #endif 279*53ee8cc1Swenshuai.xi 280*53ee8cc1Swenshuai.xi #if defined _REENTRANT || defined _THREAD_SAFE 281*53ee8cc1Swenshuai.xi # define __USE_REENTRANT 1 282*53ee8cc1Swenshuai.xi #endif 283*53ee8cc1Swenshuai.xi 284*53ee8cc1Swenshuai.xi #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \ 285*53ee8cc1Swenshuai.xi && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0 286*53ee8cc1Swenshuai.xi # if _FORTIFY_SOURCE > 1 287*53ee8cc1Swenshuai.xi # define __USE_FORTIFY_LEVEL 2 288*53ee8cc1Swenshuai.xi # else 289*53ee8cc1Swenshuai.xi # define __USE_FORTIFY_LEVEL 1 290*53ee8cc1Swenshuai.xi # endif 291*53ee8cc1Swenshuai.xi #else 292*53ee8cc1Swenshuai.xi # define __USE_FORTIFY_LEVEL 0 293*53ee8cc1Swenshuai.xi #endif 294*53ee8cc1Swenshuai.xi 295*53ee8cc1Swenshuai.xi /* Define __STDC_IEC_559__ and other similar macros. */ 296*53ee8cc1Swenshuai.xi #include <bits/predefs.h> 297*53ee8cc1Swenshuai.xi 298*53ee8cc1Swenshuai.xi /* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */ 299*53ee8cc1Swenshuai.xi #define __STDC_ISO_10646__ 200009L 300*53ee8cc1Swenshuai.xi 301*53ee8cc1Swenshuai.xi /* This macro indicates that the installed library is the GNU C Library. 302*53ee8cc1Swenshuai.xi For historic reasons the value now is 6 and this will stay from now 303*53ee8cc1Swenshuai.xi on. The use of this variable is deprecated. Use __GLIBC__ and 304*53ee8cc1Swenshuai.xi __GLIBC_MINOR__ now (see below) when you want to test for a specific 305*53ee8cc1Swenshuai.xi GNU C library version and use the values in <gnu/lib-names.h> to get 306*53ee8cc1Swenshuai.xi the sonames of the shared libraries. */ 307*53ee8cc1Swenshuai.xi #undef __GNU_LIBRARY__ 308*53ee8cc1Swenshuai.xi #define __GNU_LIBRARY__ 6 309*53ee8cc1Swenshuai.xi 310*53ee8cc1Swenshuai.xi /* Major and minor version number of the GNU C library package. Use 311*53ee8cc1Swenshuai.xi these macros to test for features in specific releases. */ 312*53ee8cc1Swenshuai.xi #define __GLIBC__ 2 313*53ee8cc1Swenshuai.xi #define __GLIBC_MINOR__ 8 314*53ee8cc1Swenshuai.xi 315*53ee8cc1Swenshuai.xi #define __GLIBC_PREREQ(maj, min) \ 316*53ee8cc1Swenshuai.xi ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) 317*53ee8cc1Swenshuai.xi 318*53ee8cc1Swenshuai.xi /* Decide whether a compiler supports the long long datatypes. */ 319*53ee8cc1Swenshuai.xi #if defined __GNUC__ \ 320*53ee8cc1Swenshuai.xi || (defined __PGI && defined __i386__ ) \ 321*53ee8cc1Swenshuai.xi || (defined __INTEL_COMPILER && (defined __i386__ || defined __ia64__)) \ 322*53ee8cc1Swenshuai.xi || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) 323*53ee8cc1Swenshuai.xi # define __GLIBC_HAVE_LONG_LONG 1 324*53ee8cc1Swenshuai.xi #endif 325*53ee8cc1Swenshuai.xi 326*53ee8cc1Swenshuai.xi /* This is here only because every header file already includes this one. */ 327*53ee8cc1Swenshuai.xi #ifndef __ASSEMBLER__ 328*53ee8cc1Swenshuai.xi # ifndef _SYS_CDEFS_H 329*53ee8cc1Swenshuai.xi # include <sys/cdefs.h> 330*53ee8cc1Swenshuai.xi # endif 331*53ee8cc1Swenshuai.xi 332*53ee8cc1Swenshuai.xi /* If we don't have __REDIRECT, prototypes will be missing if 333*53ee8cc1Swenshuai.xi __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ 334*53ee8cc1Swenshuai.xi # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT 335*53ee8cc1Swenshuai.xi # define __USE_LARGEFILE 1 336*53ee8cc1Swenshuai.xi # define __USE_LARGEFILE64 1 337*53ee8cc1Swenshuai.xi # endif 338*53ee8cc1Swenshuai.xi 339*53ee8cc1Swenshuai.xi #endif /* !ASSEMBLER */ 340*53ee8cc1Swenshuai.xi 341*53ee8cc1Swenshuai.xi /* Decide whether we can define 'extern inline' functions in headers. */ 342*53ee8cc1Swenshuai.xi #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ 343*53ee8cc1Swenshuai.xi && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ 344*53ee8cc1Swenshuai.xi && defined __extern_inline 345*53ee8cc1Swenshuai.xi # define __USE_EXTERN_INLINES 1 346*53ee8cc1Swenshuai.xi #endif 347*53ee8cc1Swenshuai.xi 348*53ee8cc1Swenshuai.xi /* There are some functions that must be declared 'extern inline' even with 349*53ee8cc1Swenshuai.xi -Os when building LIBC, or they'll end up undefined. */ 350*53ee8cc1Swenshuai.xi #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ 351*53ee8cc1Swenshuai.xi && (defined _LIBC || !defined __OPTIMIZE_SIZE__) && !defined __NO_INLINE__ \ 352*53ee8cc1Swenshuai.xi && defined __extern_inline 353*53ee8cc1Swenshuai.xi # define __USE_EXTERN_INLINES_IN_LIBC 1 354*53ee8cc1Swenshuai.xi #endif 355*53ee8cc1Swenshuai.xi 356*53ee8cc1Swenshuai.xi 357*53ee8cc1Swenshuai.xi /* This is here only because every header file already includes this one. 358*53ee8cc1Swenshuai.xi Get the definitions of all the appropriate `__stub_FUNCTION' symbols. 359*53ee8cc1Swenshuai.xi <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub 360*53ee8cc1Swenshuai.xi that will always return failure (and set errno to ENOSYS). */ 361*53ee8cc1Swenshuai.xi #include <gnu/stubs.h> 362*53ee8cc1Swenshuai.xi 363*53ee8cc1Swenshuai.xi 364*53ee8cc1Swenshuai.xi #endif /* features.h */ 365