source: trunk/src/emx/include/features.h@ 1065

Last change on this file since 1065 was 1065, checked in by bird, 22 years ago

Initial hacking.

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