features.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. /* Copyright (C) 1991-2023 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <https://www.gnu.org/licenses/>. */
  14. #ifndef _FEATURES_H
  15. #define _FEATURES_H 1
  16. /* These are defined by the user (or the compiler)
  17. to specify the desired environment:
  18. __STRICT_ANSI__ ISO Standard C.
  19. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99.
  20. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11.
  21. _ISOC2X_SOURCE Extensions to ISO C99 from ISO C2X.
  22. __STDC_WANT_LIB_EXT2__
  23. Extensions to ISO C99 from TR 27431-2:2010.
  24. __STDC_WANT_IEC_60559_BFP_EXT__
  25. Extensions to ISO C11 from TS 18661-1:2014.
  26. __STDC_WANT_IEC_60559_FUNCS_EXT__
  27. Extensions to ISO C11 from TS 18661-4:2015.
  28. __STDC_WANT_IEC_60559_TYPES_EXT__
  29. Extensions to ISO C11 from TS 18661-3:2015.
  30. __STDC_WANT_IEC_60559_EXT__
  31. ISO C2X interfaces defined only in Annex F.
  32. _POSIX_SOURCE IEEE Std 1003.1.
  33. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
  34. if >=199309L, add IEEE Std 1003.1b-1993;
  35. if >=199506L, add IEEE Std 1003.1c-1995;
  36. if >=200112L, all of IEEE 1003.1-2004
  37. if >=200809L, all of IEEE 1003.1-2008
  38. _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if
  39. Single Unix conformance is wanted, to 600 for the
  40. sixth revision, to 700 for the seventh revision.
  41. _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
  42. _LARGEFILE_SOURCE Some more functions for correct standard I/O.
  43. _LARGEFILE64_SOURCE Additional functionality from LFS for large files.
  44. _FILE_OFFSET_BITS=N Select default filesystem interface.
  45. _ATFILE_SOURCE Additional *at interfaces.
  46. _DYNAMIC_STACK_SIZE_SOURCE Select correct (but non compile-time constant)
  47. MINSIGSTKSZ, SIGSTKSZ and PTHREAD_STACK_MIN.
  48. _GNU_SOURCE All of the above, plus GNU extensions.
  49. _DEFAULT_SOURCE The default set of features (taking precedence over
  50. __STRICT_ANSI__).
  51. _FORTIFY_SOURCE Add security hardening to many library functions.
  52. Set to 1, 2 or 3; 3 performs stricter checks than 2, which
  53. performs stricter checks than 1.
  54. _REENTRANT, _THREAD_SAFE
  55. Obsolete; equivalent to _POSIX_C_SOURCE=199506L.
  56. The `-ansi' switch to the GNU C compiler, and standards conformance
  57. options such as `-std=c99', define __STRICT_ANSI__. If none of
  58. these are defined, or if _DEFAULT_SOURCE is defined, the default is
  59. to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
  60. 200809L, as well as enabling miscellaneous functions from BSD and
  61. SVID. If more than one of these are defined, they accumulate. For
  62. example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together
  63. give you ISO C, 1003.1, and 1003.2, but nothing else.
  64. These are defined by this file and are used by the
  65. header files to decide what to declare or define:
  66. __GLIBC_USE (F) Define things from feature set F. This is defined
  67. to 1 or 0; the subsequent macros are either defined
  68. or undefined, and those tests should be moved to
  69. __GLIBC_USE.
  70. __USE_ISOC11 Define ISO C11 things.
  71. __USE_ISOC99 Define ISO C99 things.
  72. __USE_ISOC95 Define ISO C90 AMD1 (C95) things.
  73. __USE_ISOCXX11 Define ISO C++11 things.
  74. __USE_POSIX Define IEEE Std 1003.1 things.
  75. __USE_POSIX2 Define IEEE Std 1003.2 things.
  76. __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things.
  77. __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things.
  78. __USE_XOPEN Define XPG things.
  79. __USE_XOPEN_EXTENDED Define X/Open Unix things.
  80. __USE_UNIX98 Define Single Unix V2 things.
  81. __USE_XOPEN2K Define XPG6 things.
  82. __USE_XOPEN2KXSI Define XPG6 XSI things.
  83. __USE_XOPEN2K8 Define XPG7 things.
  84. __USE_XOPEN2K8XSI Define XPG7 XSI things.
  85. __USE_LARGEFILE Define correct standard I/O things.
  86. __USE_LARGEFILE64 Define LFS things with separate names.
  87. __USE_FILE_OFFSET64 Define 64bit interface as default.
  88. __USE_MISC Define things from 4.3BSD or System V Unix.
  89. __USE_ATFILE Define *at interfaces and AT_* constants for them.
  90. __USE_DYNAMIC_STACK_SIZE Define correct (but non compile-time constant)
  91. MINSIGSTKSZ, SIGSTKSZ and PTHREAD_STACK_MIN.
  92. __USE_GNU Define GNU extensions.
  93. __USE_FORTIFY_LEVEL Additional security measures used, according to level.
  94. The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
  95. defined by this file unconditionally. `__GNU_LIBRARY__' is provided
  96. only for compatibility. All new code should use the other symbols
  97. to test for features.
  98. All macros listed above as possibly being defined by this file are
  99. explicitly undefined if they are not explicitly defined.
  100. Feature-test macros that are not defined by the user or compiler
  101. but are implied by the other feature-test macros defined (or by the
  102. lack of any definitions) are defined by the file.
  103. ISO C feature test macros depend on the definition of the macro
  104. when an affected header is included, not when the first system
  105. header is included, and so they are handled in
  106. <bits/libc-header-start.h>, which does not have a multiple include
  107. guard. Feature test macros that can be handled from the first
  108. system header included are handled here. */
  109. /* Undefine everything, so we get a clean slate. */
  110. #undef __USE_ISOC11
  111. #undef __USE_ISOC99
  112. #undef __USE_ISOC95
  113. #undef __USE_ISOCXX11
  114. #undef __USE_POSIX
  115. #undef __USE_POSIX2
  116. #undef __USE_POSIX199309
  117. #undef __USE_POSIX199506
  118. #undef __USE_XOPEN
  119. #undef __USE_XOPEN_EXTENDED
  120. #undef __USE_UNIX98
  121. #undef __USE_XOPEN2K
  122. #undef __USE_XOPEN2KXSI
  123. #undef __USE_XOPEN2K8
  124. #undef __USE_XOPEN2K8XSI
  125. #undef __USE_LARGEFILE
  126. #undef __USE_LARGEFILE64
  127. #undef __USE_FILE_OFFSET64
  128. #undef __USE_MISC
  129. #undef __USE_ATFILE
  130. #undef __USE_DYNAMIC_STACK_SIZE
  131. #undef __USE_GNU
  132. #undef __USE_FORTIFY_LEVEL
  133. #undef __KERNEL_STRICT_NAMES
  134. #undef __GLIBC_USE_ISOC2X
  135. #undef __GLIBC_USE_DEPRECATED_GETS
  136. #undef __GLIBC_USE_DEPRECATED_SCANF
  137. /* Suppress kernel-name space pollution unless user expressedly asks
  138. for it. */
  139. #ifndef _LOOSE_KERNEL_NAMES
  140. # define __KERNEL_STRICT_NAMES
  141. #endif
  142. /* Convenience macro to test the version of gcc.
  143. Use like this:
  144. #if __GNUC_PREREQ (2,8)
  145. ... code requiring gcc 2.8 or later ...
  146. #endif
  147. Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was
  148. added in 2.0. */
  149. #if defined __GNUC__ && defined __GNUC_MINOR__
  150. # define __GNUC_PREREQ(maj, min) \
  151. ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
  152. #else
  153. # define __GNUC_PREREQ(maj, min) 0
  154. #endif
  155. /* Similarly for clang. Features added to GCC after version 4.2 may
  156. or may not also be available in clang, and clang's definitions of
  157. __GNUC(_MINOR)__ are fixed at 4 and 2 respectively. Not all such
  158. features can be queried via __has_extension/__has_feature. */
  159. #if defined __clang_major__ && defined __clang_minor__
  160. # define __glibc_clang_prereq(maj, min) \
  161. ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
  162. #else
  163. # define __glibc_clang_prereq(maj, min) 0
  164. #endif
  165. /* Whether to use feature set F. */
  166. #define __GLIBC_USE(F) __GLIBC_USE_ ## F
  167. /* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for
  168. _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not
  169. issue a warning; the expectation is that the source is being
  170. transitioned to use the new macro. */
  171. #if (defined _BSD_SOURCE || defined _SVID_SOURCE) \
  172. && !defined _DEFAULT_SOURCE
  173. # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
  174. # undef _DEFAULT_SOURCE
  175. # define _DEFAULT_SOURCE 1
  176. #endif
  177. /* If _GNU_SOURCE was defined by the user, turn on all the other features. */
  178. #ifdef _GNU_SOURCE
  179. # undef _ISOC95_SOURCE
  180. # define _ISOC95_SOURCE 1
  181. # undef _ISOC99_SOURCE
  182. # define _ISOC99_SOURCE 1
  183. # undef _ISOC11_SOURCE
  184. # define _ISOC11_SOURCE 1
  185. # undef _ISOC2X_SOURCE
  186. # define _ISOC2X_SOURCE 1
  187. # undef _POSIX_SOURCE
  188. # define _POSIX_SOURCE 1
  189. # undef _POSIX_C_SOURCE
  190. # define _POSIX_C_SOURCE 200809L
  191. # undef _XOPEN_SOURCE
  192. # define _XOPEN_SOURCE 700
  193. # undef _XOPEN_SOURCE_EXTENDED
  194. # define _XOPEN_SOURCE_EXTENDED 1
  195. # undef _LARGEFILE64_SOURCE
  196. # define _LARGEFILE64_SOURCE 1
  197. # undef _DEFAULT_SOURCE
  198. # define _DEFAULT_SOURCE 1
  199. # undef _ATFILE_SOURCE
  200. # define _ATFILE_SOURCE 1
  201. # undef _DYNAMIC_STACK_SIZE_SOURCE
  202. # define _DYNAMIC_STACK_SIZE_SOURCE 1
  203. #endif
  204. /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,
  205. define _DEFAULT_SOURCE. */
  206. #if (defined _DEFAULT_SOURCE \
  207. || (!defined __STRICT_ANSI__ \
  208. && !defined _ISOC99_SOURCE && !defined _ISOC11_SOURCE \
  209. && !defined _ISOC2X_SOURCE \
  210. && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \
  211. && !defined _XOPEN_SOURCE))
  212. # undef _DEFAULT_SOURCE
  213. # define _DEFAULT_SOURCE 1
  214. #endif
  215. /* This is to enable the ISO C2X extension. */
  216. #if (defined _ISOC2X_SOURCE \
  217. || (defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L))
  218. # define __GLIBC_USE_ISOC2X 1
  219. #else
  220. # define __GLIBC_USE_ISOC2X 0
  221. #endif
  222. /* This is to enable the ISO C11 extension. */
  223. #if (defined _ISOC11_SOURCE || defined _ISOC2X_SOURCE \
  224. || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
  225. # define __USE_ISOC11 1
  226. #endif
  227. /* This is to enable the ISO C99 extension. */
  228. #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
  229. || defined _ISOC2X_SOURCE \
  230. || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
  231. # define __USE_ISOC99 1
  232. #endif
  233. /* This is to enable the ISO C90 Amendment 1:1995 extension. */
  234. #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
  235. || defined _ISOC2X_SOURCE \
  236. || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L))
  237. # define __USE_ISOC95 1
  238. #endif
  239. #ifdef __cplusplus
  240. /* This is to enable compatibility for ISO C++17. */
  241. # if __cplusplus >= 201703L
  242. # define __USE_ISOC11 1
  243. # endif
  244. /* This is to enable compatibility for ISO C++11.
  245. Check the temporary macro for now, too. */
  246. # if __cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__
  247. # define __USE_ISOCXX11 1
  248. # define __USE_ISOC99 1
  249. # endif
  250. #endif
  251. /* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE
  252. is defined, use POSIX.1-2008 (or another version depending on
  253. _XOPEN_SOURCE). */
  254. #ifdef _DEFAULT_SOURCE
  255. # if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE
  256. # define __USE_POSIX_IMPLICITLY 1
  257. # endif
  258. # undef _POSIX_SOURCE
  259. # define _POSIX_SOURCE 1
  260. # undef _POSIX_C_SOURCE
  261. # define _POSIX_C_SOURCE 200809L
  262. #endif
  263. #if ((!defined __STRICT_ANSI__ \
  264. || (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500)) \
  265. && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE)
  266. # define _POSIX_SOURCE 1
  267. # if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500
  268. # define _POSIX_C_SOURCE 2
  269. # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600
  270. # define _POSIX_C_SOURCE 199506L
  271. # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700
  272. # define _POSIX_C_SOURCE 200112L
  273. # else
  274. # define _POSIX_C_SOURCE 200809L
  275. # endif
  276. # define __USE_POSIX_IMPLICITLY 1
  277. #endif
  278. /* Some C libraries once required _REENTRANT and/or _THREAD_SAFE to be
  279. defined in all multithreaded code. GNU libc has not required this
  280. for many years. We now treat them as compatibility synonyms for
  281. _POSIX_C_SOURCE=199506L, which is the earliest level of POSIX with
  282. comprehensive support for multithreaded code. Using them never
  283. lowers the selected level of POSIX conformance, only raises it. */
  284. #if ((!defined _POSIX_C_SOURCE || (_POSIX_C_SOURCE - 0) < 199506L) \
  285. && (defined _REENTRANT || defined _THREAD_SAFE))
  286. # define _POSIX_SOURCE 1
  287. # undef _POSIX_C_SOURCE
  288. # define _POSIX_C_SOURCE 199506L
  289. #endif
  290. #if (defined _POSIX_SOURCE \
  291. || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 1) \
  292. || defined _XOPEN_SOURCE)
  293. # define __USE_POSIX 1
  294. #endif
  295. #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
  296. # define __USE_POSIX2 1
  297. #endif
  298. #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L
  299. # define __USE_POSIX199309 1
  300. #endif
  301. #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199506L
  302. # define __USE_POSIX199506 1
  303. #endif
  304. #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200112L
  305. # define __USE_XOPEN2K 1
  306. # undef __USE_ISOC95
  307. # define __USE_ISOC95 1
  308. # undef __USE_ISOC99
  309. # define __USE_ISOC99 1
  310. #endif
  311. #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200809L
  312. # define __USE_XOPEN2K8 1
  313. # undef _ATFILE_SOURCE
  314. # define _ATFILE_SOURCE 1
  315. #endif
  316. #ifdef _XOPEN_SOURCE
  317. # define __USE_XOPEN 1
  318. # if (_XOPEN_SOURCE - 0) >= 500
  319. # define __USE_XOPEN_EXTENDED 1
  320. # define __USE_UNIX98 1
  321. # undef _LARGEFILE_SOURCE
  322. # define _LARGEFILE_SOURCE 1
  323. # if (_XOPEN_SOURCE - 0) >= 600
  324. # if (_XOPEN_SOURCE - 0) >= 700
  325. # define __USE_XOPEN2K8 1
  326. # define __USE_XOPEN2K8XSI 1
  327. # endif
  328. # define __USE_XOPEN2K 1
  329. # define __USE_XOPEN2KXSI 1
  330. # undef __USE_ISOC95
  331. # define __USE_ISOC95 1
  332. # undef __USE_ISOC99
  333. # define __USE_ISOC99 1
  334. # endif
  335. # else
  336. # ifdef _XOPEN_SOURCE_EXTENDED
  337. # define __USE_XOPEN_EXTENDED 1
  338. # endif
  339. # endif
  340. #endif
  341. #ifdef _LARGEFILE_SOURCE
  342. # define __USE_LARGEFILE 1
  343. #endif
  344. #ifdef _LARGEFILE64_SOURCE
  345. # define __USE_LARGEFILE64 1
  346. #endif
  347. #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
  348. # define __USE_FILE_OFFSET64 1
  349. #endif
  350. #include <features-time64.h>
  351. #if defined _DEFAULT_SOURCE
  352. # define __USE_MISC 1
  353. #endif
  354. #ifdef _ATFILE_SOURCE
  355. # define __USE_ATFILE 1
  356. #endif
  357. #ifdef _DYNAMIC_STACK_SIZE_SOURCE
  358. # define __USE_DYNAMIC_STACK_SIZE 1
  359. #endif
  360. #ifdef _GNU_SOURCE
  361. # define __USE_GNU 1
  362. #endif
  363. #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0
  364. # if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0
  365. # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
  366. # elif !__GNUC_PREREQ (4, 1)
  367. # warning _FORTIFY_SOURCE requires GCC 4.1 or later
  368. # elif _FORTIFY_SOURCE > 2 && (__glibc_clang_prereq (9, 0) \
  369. || __GNUC_PREREQ (12, 0))
  370. # if _FORTIFY_SOURCE > 3
  371. # warning _FORTIFY_SOURCE > 3 is treated like 3 on this platform
  372. # endif
  373. # define __USE_FORTIFY_LEVEL 3
  374. # elif _FORTIFY_SOURCE > 1
  375. # if _FORTIFY_SOURCE > 2
  376. # warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform
  377. # endif
  378. # define __USE_FORTIFY_LEVEL 2
  379. # else
  380. # define __USE_FORTIFY_LEVEL 1
  381. # endif
  382. #endif
  383. #ifndef __USE_FORTIFY_LEVEL
  384. # define __USE_FORTIFY_LEVEL 0
  385. #endif
  386. /* The function 'gets' existed in C89, but is impossible to use
  387. safely. It has been removed from ISO C11 and ISO C++14. Note: for
  388. compatibility with various implementations of <cstdio>, this test
  389. must consider only the value of __cplusplus when compiling C++. */
  390. #if defined __cplusplus ? __cplusplus >= 201402L : defined __USE_ISOC11
  391. # define __GLIBC_USE_DEPRECATED_GETS 0
  392. #else
  393. # define __GLIBC_USE_DEPRECATED_GETS 1
  394. #endif
  395. /* GNU formerly extended the scanf functions with modified format
  396. specifiers %as, %aS, and %a[...] that allocate a buffer for the
  397. input using malloc. This extension conflicts with ISO C99, which
  398. defines %a as a standalone format specifier that reads a floating-
  399. point number; moreover, POSIX.1-2008 provides the same feature
  400. using the modifier letter 'm' instead (%ms, %mS, %m[...]).
  401. We now follow C99 unless GNU extensions are active and the compiler
  402. is specifically in C89 or C++98 mode (strict or not). For
  403. instance, with GCC, -std=gnu11 will have C99-compliant scanf with
  404. or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the
  405. old extension. */
  406. #if (defined __USE_GNU \
  407. && (defined __cplusplus \
  408. ? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \
  409. : (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L)))
  410. # define __GLIBC_USE_DEPRECATED_SCANF 1
  411. #else
  412. # define __GLIBC_USE_DEPRECATED_SCANF 0
  413. #endif
  414. /* Get definitions of __STDC_* predefined macros, if the compiler has
  415. not preincluded this header automatically. */
  416. #include <stdc-predef.h>
  417. /* This macro indicates that the installed library is the GNU C Library.
  418. For historic reasons the value now is 6 and this will stay from now
  419. on. The use of this variable is deprecated. Use __GLIBC__ and
  420. __GLIBC_MINOR__ now (see below) when you want to test for a specific
  421. GNU C library version and use the values in <gnu/lib-names.h> to get
  422. the sonames of the shared libraries. */
  423. #undef __GNU_LIBRARY__
  424. #define __GNU_LIBRARY__ 6
  425. /* Major and minor version number of the GNU C library package. Use
  426. these macros to test for features in specific releases. */
  427. #define __GLIBC__ 2
  428. #define __GLIBC_MINOR__ 37
  429. #define __GLIBC_PREREQ(maj, min) \
  430. ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
  431. /* This is here only because every header file already includes this one. */
  432. #ifndef __ASSEMBLER__
  433. # ifndef _SYS_CDEFS_H
  434. # include <sys/cdefs.h>
  435. # endif
  436. /* If we don't have __REDIRECT, prototypes will be missing if
  437. __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */
  438. # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
  439. # define __USE_LARGEFILE 1
  440. # define __USE_LARGEFILE64 1
  441. # endif
  442. #endif /* !ASSEMBLER */
  443. /* Decide whether we can define 'extern inline' functions in headers. */
  444. #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
  445. && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
  446. && defined __extern_inline
  447. # define __USE_EXTERN_INLINES 1
  448. #endif
  449. /* This is here only because every header file already includes this one.
  450. Get the definitions of all the appropriate `__stub_FUNCTION' symbols.
  451. <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
  452. that will always return failure (and set errno to ENOSYS). */
  453. #include <gnu/stubs.h>
  454. #endif /* features.h */