libc-header-start.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Handle feature test macros at the start of a header.
  2. Copyright (C) 2016-2021 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  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. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. /* This header is internal to glibc and should not be included outside
  16. of glibc headers. Headers including it must define
  17. __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header
  18. cannot have multiple include guards because ISO C feature test
  19. macros depend on the definition of the macro when an affected
  20. header is included, not when the first system header is
  21. included. */
  22. #ifndef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
  23. # error "Never include <bits/libc-header-start.h> directly."
  24. #endif
  25. #undef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
  26. #include <features.h>
  27. /* ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__
  28. macro. */
  29. #undef __GLIBC_USE_LIB_EXT2
  30. #if (defined __USE_GNU \
  31. || (defined __STDC_WANT_LIB_EXT2__ && __STDC_WANT_LIB_EXT2__ > 0))
  32. # define __GLIBC_USE_LIB_EXT2 1
  33. #else
  34. # define __GLIBC_USE_LIB_EXT2 0
  35. #endif
  36. /* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
  37. macro. Most but not all symbols enabled by that macro in TS
  38. 18661-1 are enabled unconditionally in C2X; the symbols in Annex F
  39. still require that macro in C2X. */
  40. #undef __GLIBC_USE_IEC_60559_BFP_EXT
  41. #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__
  42. # define __GLIBC_USE_IEC_60559_BFP_EXT 1
  43. #else
  44. # define __GLIBC_USE_IEC_60559_BFP_EXT 0
  45. #endif
  46. #undef __GLIBC_USE_IEC_60559_BFP_EXT_C2X
  47. #if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X)
  48. # define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 1
  49. #else
  50. # define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0
  51. #endif
  52. /* ISO/IEC TS 18661-4:2015 defines the
  53. __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction
  54. functions, the symbols from this TS are enabled unconditionally in
  55. C2X. */
  56. #undef __GLIBC_USE_IEC_60559_FUNCS_EXT
  57. #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__
  58. # define __GLIBC_USE_IEC_60559_FUNCS_EXT 1
  59. #else
  60. # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
  61. #endif
  62. #undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X
  63. #if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC2X)
  64. # define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 1
  65. #else
  66. # define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0
  67. #endif
  68. /* ISO/IEC TS 18661-3:2015 defines the
  69. __STDC_WANT_IEC_60559_TYPES_EXT__ macro. */
  70. #undef __GLIBC_USE_IEC_60559_TYPES_EXT
  71. #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_TYPES_EXT__
  72. # define __GLIBC_USE_IEC_60559_TYPES_EXT 1
  73. #else
  74. # define __GLIBC_USE_IEC_60559_TYPES_EXT 0
  75. #endif