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