]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/Include/sys/featuretest.h
Fix GCC build errors.
[mirror_edk2.git] / StdLib / Include / sys / featuretest.h
CommitLineData
2aa62f2b 1/* $NetBSD: featuretest.h,v 1.8 2005/12/11 12:25:20 christos Exp $ */\r
2\r
3/*\r
4 * Written by Klaus Klein <kleink@NetBSD.org>, February 2, 1998.\r
5 * Public domain.\r
6 *\r
7 * NOTE: Do not protect this header against multiple inclusion. Doing\r
8 * so can have subtle side-effects due to header file inclusion order\r
9 * and testing of e.g. _POSIX_SOURCE vs. _POSIX_C_SOURCE. Instead,\r
10 * protect each CPP macro that we want to supply.\r
11 */\r
12\r
13/*\r
14 * Feature-test macros are defined by several standards, and allow an\r
15 * application to specify what symbols they want the system headers to\r
16 * expose, and hence what standard they want them to conform to.\r
17 * There are two classes of feature-test macros. The first class\r
18 * specify complete standards, and if one of these is defined, header\r
19 * files will try to conform to the relevant standard. They are:\r
20 *\r
21 * ANSI macros:\r
22 * _ANSI_SOURCE ANSI C89\r
23 *\r
24 * POSIX macros:\r
25 * _POSIX_SOURCE == 1 IEEE Std 1003.1 (version?)\r
26 * _POSIX_C_SOURCE == 1 IEEE Std 1003.1-1990\r
27 * _POSIX_C_SOURCE == 2 IEEE Std 1003.2-1992\r
28 * _POSIX_C_SOURCE == 199309L IEEE Std 1003.1b-1993\r
29 * _POSIX_C_SOURCE == 199506L ISO/IEC 9945-1:1996\r
30 * _POSIX_C_SOURCE == 200112L IEEE Std 1003.1-2001\r
31 *\r
32 * X/Open macros:\r
33 * _XOPEN_SOURCE System Interfaces and Headers, Issue 4, Ver 2\r
34 * _XOPEN_SOURCE_EXTENDED == 1 XSH4.2 UNIX extensions\r
35 * _XOPEN_SOURCE == 500 System Interfaces and Headers, Issue 5\r
36 * _XOPEN_SOURCE == 520 Networking Services (XNS), Issue 5.2\r
37 * _XOPEN_SOURCE == 600 IEEE Std 1003.1-2001, XSI option\r
38 *\r
39 * NetBSD macros:\r
40 * _NETBSD_SOURCE == 1 Make all NetBSD features available.\r
41 *\r
42 * If more than one of these "major" feature-test macros is defined,\r
43 * then the set of facilities provided (and namespace used) is the\r
44 * union of that specified by the relevant standards, and in case of\r
45 * conflict, the earlier standard in the above list has precedence (so\r
46 * if both _POSIX_C_SOURCE and _NETBSD_SOURCE are defined, the version\r
47 * of rename() that's used is the POSIX one). If none of the "major"\r
48 * feature-test macros is defined, _NETBSD_SOURCE is assumed.\r
49 *\r
50 * There are also "minor" feature-test macros, which enable extra\r
51 * functionality in addition to some base standard. They should be\r
52 * defined along with one of the "major" macros. The "minor" macros\r
53 * are:\r
54 *\r
55 * _REENTRANT\r
56 * _ISOC99_SOURCE\r
57 * _LARGEFILE_SOURCE Large File Support\r
58 * <http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>\r
59 */\r
60\r
61#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)\r
62#define _POSIX_C_SOURCE 1L\r
63#endif\r
64\r
65#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \\r
66 !defined(_XOPEN_SOURCE) && !defined(_NETBSD_SOURCE)\r
67#define _NETBSD_SOURCE 1\r
68#endif\r
69\r
70#if ((_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500) && \\r
71 !defined(_REENTRANT)\r
72#define _REENTRANT\r
73#endif\r