]>
Commit | Line | Data |
---|---|---|
48789000 | 1 | /* Handle feature test macros at the start of a header. |
dff8da6b | 2 | Copyright (C) 2016-2024 Free Software Foundation, Inc. |
48789000 JM |
3 | This file is part of the GNU C Library. |
4 | ||
5 | The GNU C Library is free software; you can redistribute it and/or | |
6 | modify it under the terms of the GNU Lesser General Public | |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the License, or (at your option) any later version. | |
9 | ||
10 | The GNU C Library is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | Lesser General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU Lesser General Public | |
16 | License along with the GNU C Library; if not, see | |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
48789000 JM |
18 | |
19 | /* This header is internal to glibc and should not be included outside | |
20 | of glibc headers. Headers including it must define | |
21 | __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header | |
22 | cannot have multiple include guards because ISO C feature test | |
23 | macros depend on the definition of the macro when an affected | |
24 | header is included, not when the first system header is | |
25 | included. */ | |
26 | ||
27 | #ifndef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION | |
28 | # error "Never include <bits/libc-header-start.h> directly." | |
29 | #endif | |
30 | ||
31 | #undef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION | |
32 | ||
33 | #include <features.h> | |
34 | ||
35 | /* ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__ | |
36 | macro. */ | |
37 | #undef __GLIBC_USE_LIB_EXT2 | |
38 | #if (defined __USE_GNU \ | |
39 | || (defined __STDC_WANT_LIB_EXT2__ && __STDC_WANT_LIB_EXT2__ > 0)) | |
40 | # define __GLIBC_USE_LIB_EXT2 1 | |
41 | #else | |
42 | # define __GLIBC_USE_LIB_EXT2 0 | |
43 | #endif | |
bf91be88 JM |
44 | |
45 | /* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ | |
0175c9e9 | 46 | macro. Most but not all symbols enabled by that macro in TS |
42cc619d | 47 | 18661-1 are enabled unconditionally in C23. In C23, the symbols in |
858045ad | 48 | Annex F still require a new feature test macro |
42cc619d | 49 | __STDC_WANT_IEC_60559_EXT__ instead (C23 does not define |
858045ad | 50 | __STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS |
42cc619d JM |
51 | 18661-1 are not included in C23 (and thus should depend on |
52 | __STDC_WANT_IEC_60559_BFP_EXT__ even when C23 features are | |
858045ad JM |
53 | enabled). |
54 | ||
55 | __GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS | |
42cc619d | 56 | 18661-1 not included in C23. |
858045ad | 57 | |
42cc619d JM |
58 | __GLIBC_USE (IEC_60559_BFP_EXT_C23) controls those features from TS |
59 | 18661-1 that are also included in C23 (with no feature test macro | |
60 | required in C23). | |
858045ad JM |
61 | |
62 | __GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1 | |
42cc619d | 63 | that are included in C23 but conditional on |
858045ad JM |
64 | __STDC_WANT_IEC_60559_EXT__. (There are currently no features |
65 | conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS | |
66 | 18661-1.) */ | |
bf91be88 JM |
67 | #undef __GLIBC_USE_IEC_60559_BFP_EXT |
68 | #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__ | |
69 | # define __GLIBC_USE_IEC_60559_BFP_EXT 1 | |
70 | #else | |
71 | # define __GLIBC_USE_IEC_60559_BFP_EXT 0 | |
72 | #endif | |
42cc619d JM |
73 | #undef __GLIBC_USE_IEC_60559_BFP_EXT_C23 |
74 | #if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC23) | |
75 | # define __GLIBC_USE_IEC_60559_BFP_EXT_C23 1 | |
0175c9e9 | 76 | #else |
42cc619d | 77 | # define __GLIBC_USE_IEC_60559_BFP_EXT_C23 0 |
0175c9e9 | 78 | #endif |
858045ad JM |
79 | #undef __GLIBC_USE_IEC_60559_EXT |
80 | #if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __STDC_WANT_IEC_60559_EXT__ | |
81 | # define __GLIBC_USE_IEC_60559_EXT 1 | |
82 | #else | |
83 | # define __GLIBC_USE_IEC_60559_EXT 0 | |
84 | #endif | |
412cb261 JM |
85 | |
86 | /* ISO/IEC TS 18661-4:2015 defines the | |
c3ce62cc JM |
87 | __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction |
88 | functions, the symbols from this TS are enabled unconditionally in | |
42cc619d | 89 | C23. */ |
412cb261 JM |
90 | #undef __GLIBC_USE_IEC_60559_FUNCS_EXT |
91 | #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ | |
92 | # define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 | |
93 | #else | |
94 | # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 | |
95 | #endif | |
42cc619d JM |
96 | #undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 |
97 | #if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC23) | |
98 | # define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 1 | |
c3ce62cc | 99 | #else |
42cc619d | 100 | # define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 0 |
c3ce62cc | 101 | #endif |
4fc12f0e PM |
102 | |
103 | /* ISO/IEC TS 18661-3:2015 defines the | |
104 | __STDC_WANT_IEC_60559_TYPES_EXT__ macro. */ | |
105 | #undef __GLIBC_USE_IEC_60559_TYPES_EXT | |
106 | #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_TYPES_EXT__ | |
107 | # define __GLIBC_USE_IEC_60559_TYPES_EXT 1 | |
108 | #else | |
109 | # define __GLIBC_USE_IEC_60559_TYPES_EXT 0 | |
110 | #endif |