1 // Predefined symbols and macros -*- C++ -*-
3 // Copyright (C) 1997-2020 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
25 /** @file bits/c++config.h
26 * This is an internal header file, included by other library headers.
27 * Do not attempt to use it directly. @headername{version}
30 #ifndef _GLIBCXX_CXX_CONFIG_H
31 #define _GLIBCXX_CXX_CONFIG_H 1
33 // The major release number for the GCC release the C++ library belongs to.
34 #define _GLIBCXX_RELEASE
36 // The datestamp of the C++ library in compressed ISO date format.
39 // Macros for various attributes.
44 // _GLIBCXX_VISIBILITY
46 # define _GLIBCXX_PURE __attribute__ ((__pure__))
49 #ifndef _GLIBCXX_CONST
50 # define _GLIBCXX_CONST __attribute__ ((__const__))
53 #ifndef _GLIBCXX_NORETURN
54 # define _GLIBCXX_NORETURN __attribute__ ((__noreturn__))
58 #ifndef _GLIBCXX_NOTHROW
60 # define _GLIBCXX_NOTHROW __attribute__((__nothrow__))
64 // Macros for visibility attributes.
65 // _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
66 // _GLIBCXX_VISIBILITY
67 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
69 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
70 # define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
72 // If this is not supplied by the OS-specific or CPU-specific
73 // headers included below, it will be defined to an empty default.
74 # define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
77 // Macros for deprecated attributes.
78 // _GLIBCXX_USE_DEPRECATED
79 // _GLIBCXX_DEPRECATED
80 // _GLIBCXX_DEPRECATED_SUGGEST( string-literal )
81 // _GLIBCXX11_DEPRECATED
82 // _GLIBCXX11_DEPRECATED_SUGGEST( string-literal )
83 // _GLIBCXX17_DEPRECATED
84 // _GLIBCXX17_DEPRECATED_SUGGEST( string-literal )
85 // _GLIBCXX20_DEPRECATED( string-literal )
86 // _GLIBCXX20_DEPRECATED_SUGGEST( string-literal )
87 #ifndef _GLIBCXX_USE_DEPRECATED
88 # define _GLIBCXX_USE_DEPRECATED 1
91 #if defined(__DEPRECATED)
92 # define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__))
93 # define _GLIBCXX_DEPRECATED_SUGGEST(ALT) \
94 __attribute__ ((__deprecated__ ("use '" ALT "' instead")))
96 # define _GLIBCXX_DEPRECATED
97 # define _GLIBCXX_DEPRECATED_SUGGEST(ALT)
100 #if defined(__DEPRECATED) && (__cplusplus >= 201103L)
101 # define _GLIBCXX11_DEPRECATED _GLIBCXX_DEPRECATED
102 # define _GLIBCXX11_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
104 # define _GLIBCXX11_DEPRECATED
105 # define _GLIBCXX11_DEPRECATED_SUGGEST(ALT)
108 #if defined(__DEPRECATED) && (__cplusplus >= 201703L)
109 # define _GLIBCXX17_DEPRECATED [[__deprecated__]]
110 # define _GLIBCXX17_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
112 # define _GLIBCXX17_DEPRECATED
113 # define _GLIBCXX17_DEPRECATED_SUGGEST(ALT)
116 #if defined(__DEPRECATED) && (__cplusplus > 201703L)
117 # define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
118 # define _GLIBCXX20_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
120 # define _GLIBCXX20_DEPRECATED(MSG)
121 # define _GLIBCXX20_DEPRECATED_SUGGEST(ALT)
124 // Macros for ABI tag attributes.
125 #ifndef _GLIBCXX_ABI_TAG_CXX11
126 # define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
129 // Macro to warn about unused results.
130 #if __cplusplus >= 201703L
131 # define _GLIBCXX_NODISCARD [[__nodiscard__]]
133 # define _GLIBCXX_NODISCARD
140 // Macro for constexpr, to support in mixed 03/0x mode.
141 #ifndef _GLIBCXX_CONSTEXPR
142 # if __cplusplus >= 201103L
143 # define _GLIBCXX_CONSTEXPR constexpr
144 # define _GLIBCXX_USE_CONSTEXPR constexpr
146 # define _GLIBCXX_CONSTEXPR
147 # define _GLIBCXX_USE_CONSTEXPR const
151 #ifndef _GLIBCXX14_CONSTEXPR
152 # if __cplusplus >= 201402L
153 # define _GLIBCXX14_CONSTEXPR constexpr
155 # define _GLIBCXX14_CONSTEXPR
159 #ifndef _GLIBCXX17_CONSTEXPR
160 # if __cplusplus >= 201703L
161 # define _GLIBCXX17_CONSTEXPR constexpr
163 # define _GLIBCXX17_CONSTEXPR
167 #ifndef _GLIBCXX20_CONSTEXPR
168 # if __cplusplus > 201703L
169 # define _GLIBCXX20_CONSTEXPR constexpr
171 # define _GLIBCXX20_CONSTEXPR
175 #ifndef _GLIBCXX17_INLINE
176 # if __cplusplus >= 201703L
177 # define _GLIBCXX17_INLINE inline
179 # define _GLIBCXX17_INLINE
183 // Macro for noexcept, to support in mixed 03/0x mode.
184 #ifndef _GLIBCXX_NOEXCEPT
185 # if __cplusplus >= 201103L
186 # define _GLIBCXX_NOEXCEPT noexcept
187 # define _GLIBCXX_NOEXCEPT_IF(...) noexcept(__VA_ARGS__)
188 # define _GLIBCXX_USE_NOEXCEPT noexcept
189 # define _GLIBCXX_THROW(_EXC)
191 # define _GLIBCXX_NOEXCEPT
192 # define _GLIBCXX_NOEXCEPT_IF(...)
193 # define _GLIBCXX_USE_NOEXCEPT throw()
194 # define _GLIBCXX_THROW(_EXC) throw(_EXC)
198 #ifndef _GLIBCXX_NOTHROW
199 # define _GLIBCXX_NOTHROW _GLIBCXX_USE_NOEXCEPT
202 #ifndef _GLIBCXX_THROW_OR_ABORT
203 # if __cpp_exceptions
204 # define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC))
206 # define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort())
210 #if __cpp_noexcept_function_type
211 #define _GLIBCXX_NOEXCEPT_PARM , bool _NE
212 #define _GLIBCXX_NOEXCEPT_QUAL noexcept (_NE)
214 #define _GLIBCXX_NOEXCEPT_PARM
215 #define _GLIBCXX_NOEXCEPT_QUAL
218 // Macro for extern template, ie controlling template linkage via use
219 // of extern keyword on template declaration. As documented in the g++
220 // manual, it inhibits all implicit instantiations and is used
221 // throughout the library to avoid multiple weak definitions for
222 // required types that are already explicitly instantiated in the
223 // library binary. This substantially reduces the binary size of
224 // resulting executables.
225 // Special case: _GLIBCXX_EXTERN_TEMPLATE == -1 disallows extern
226 // templates only in basic_string, thus activating its debug-mode
227 // checks even at -O0.
228 #define _GLIBCXX_EXTERN_TEMPLATE
231 Outline of libstdc++ namespaces.
235 namespace __debug { }
236 namespace __parallel { }
237 namespace __cxx1998 { }
240 namespace __variant { } // C++17
243 namespace rel_ops { }
247 namespace placeholders { }
248 namespace regex_constants { }
249 namespace __detail { }
254 namespace decimal { }
256 namespace chrono { } // C++11
257 namespace placeholders { } // C++11
258 namespace regex_constants { } // C++11
259 namespace this_thread { } // C++11
260 inline namespace literals { // C++14
261 inline namespace chrono_literals { } // C++14
262 inline namespace complex_literals { } // C++14
263 inline namespace string_literals { } // C++14
264 inline namespace string_view_literals { } // C++17
272 namespace __detail { }
275 For full details see:
276 http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html
280 typedef __SIZE_TYPE__ size_t;
281 typedef __PTRDIFF_TYPE__ ptrdiff_t;
283 #if __cplusplus >= 201103L
284 typedef decltype(nullptr) nullptr_t;
288 #define _GLIBCXX_USE_DUAL_ABI
290 #if ! _GLIBCXX_USE_DUAL_ABI
291 // Ignore any pre-defined value of _GLIBCXX_USE_CXX11_ABI
292 # undef _GLIBCXX_USE_CXX11_ABI
295 #ifndef _GLIBCXX_USE_CXX11_ABI
296 #define _GLIBCXX_USE_CXX11_ABI
299 #if _GLIBCXX_USE_CXX11_ABI
302 inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
306 inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
308 # define _GLIBCXX_NAMESPACE_CXX11 __cxx11::
309 # define _GLIBCXX_BEGIN_NAMESPACE_CXX11 namespace __cxx11 {
310 # define _GLIBCXX_END_NAMESPACE_CXX11 }
311 # define _GLIBCXX_DEFAULT_ABI_TAG _GLIBCXX_ABI_TAG_CXX11
313 # define _GLIBCXX_NAMESPACE_CXX11
314 # define _GLIBCXX_BEGIN_NAMESPACE_CXX11
315 # define _GLIBCXX_END_NAMESPACE_CXX11
316 # define _GLIBCXX_DEFAULT_ABI_TAG
319 // Defined if inline namespaces are used for versioning.
320 #define _GLIBCXX_INLINE_VERSION
322 // Inline namespace for symbol versioning.
323 #if _GLIBCXX_INLINE_VERSION
324 # define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __8 {
325 # define _GLIBCXX_END_NAMESPACE_VERSION }
329 inline _GLIBCXX_BEGIN_NAMESPACE_VERSION
330 #if __cplusplus >= 201402L
331 inline namespace literals {
332 inline namespace chrono_literals { }
333 inline namespace complex_literals { }
334 inline namespace string_literals { }
335 #if __cplusplus > 201402L
336 inline namespace string_view_literals { }
340 _GLIBCXX_END_NAMESPACE_VERSION
345 inline _GLIBCXX_BEGIN_NAMESPACE_VERSION
346 _GLIBCXX_END_NAMESPACE_VERSION
350 # define _GLIBCXX_BEGIN_NAMESPACE_VERSION
351 # define _GLIBCXX_END_NAMESPACE_VERSION
354 // Inline namespaces for special modes: debug, parallel.
355 #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
358 _GLIBCXX_BEGIN_NAMESPACE_VERSION
360 // Non-inline namespace for components replaced by alternates in active mode.
363 # if _GLIBCXX_USE_CXX11_ABI
364 inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
368 _GLIBCXX_END_NAMESPACE_VERSION
370 // Inline namespace for debug mode.
371 # ifdef _GLIBCXX_DEBUG
372 inline namespace __debug { }
375 // Inline namespaces for parallel mode.
376 # ifdef _GLIBCXX_PARALLEL
377 inline namespace __parallel { }
381 // Check for invalid usage and unsupported mixed-mode use.
382 # if defined(_GLIBCXX_DEBUG) && defined(_GLIBCXX_PARALLEL)
383 # error illegal use of multiple inlined namespaces
386 // Check for invalid use due to lack for weak symbols.
387 # if __NO_INLINE__ && !__GXX_WEAK__
388 # warning currently using inlined namespace mode which may fail \
389 without inlining due to lack of weak symbols
393 // Macros for namespace scope. Either namespace std:: or the name
394 // of some nested namespace within it corresponding to the active mode.
398 // Macros for opening/closing conditional namespaces.
399 // _GLIBCXX_BEGIN_NAMESPACE_ALGO
400 // _GLIBCXX_END_NAMESPACE_ALGO
401 // _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
402 // _GLIBCXX_END_NAMESPACE_CONTAINER
403 #if defined(_GLIBCXX_DEBUG)
404 # define _GLIBCXX_STD_C __cxx1998
405 # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \
406 namespace _GLIBCXX_STD_C {
407 # define _GLIBCXX_END_NAMESPACE_CONTAINER }
409 # define _GLIBCXX_STD_C std
410 # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
411 # define _GLIBCXX_END_NAMESPACE_CONTAINER
414 #ifdef _GLIBCXX_PARALLEL
415 # define _GLIBCXX_STD_A __cxx1998
416 # define _GLIBCXX_BEGIN_NAMESPACE_ALGO \
417 namespace _GLIBCXX_STD_A {
418 # define _GLIBCXX_END_NAMESPACE_ALGO }
420 # define _GLIBCXX_STD_A std
421 # define _GLIBCXX_BEGIN_NAMESPACE_ALGO
422 # define _GLIBCXX_END_NAMESPACE_ALGO
425 // GLIBCXX_ABI Deprecated
426 // Define if compatibility should be provided for -mlong-double-64.
427 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
428 // Define if compatibility should be provided for alternative 128-bit long
430 #undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
432 // Inline namespaces for long double 128 modes.
433 #if defined _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT \
434 && defined __LONG_DOUBLE_IEEE128__
437 // Namespaces for 128-bit IEEE long double format on 64-bit POWER LE.
438 inline namespace __gnu_cxx_ieee128 { }
439 inline namespace __gnu_cxx11_ieee128 { }
441 # define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ieee128::
442 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ieee128 {
443 # define _GLIBCXX_END_NAMESPACE_LDBL }
444 # define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 __gnu_cxx11_ieee128::
445 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 namespace __gnu_cxx11_ieee128 {
446 # define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 }
448 #else // _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && IEEE128
450 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
453 inline namespace __gnu_cxx_ldbl128 { }
455 # define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ldbl128::
456 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ldbl128 {
457 # define _GLIBCXX_END_NAMESPACE_LDBL }
459 # define _GLIBCXX_NAMESPACE_LDBL
460 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL
461 # define _GLIBCXX_END_NAMESPACE_LDBL
464 #if _GLIBCXX_USE_CXX11_ABI
465 # define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_CXX11
466 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_CXX11
467 # define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_CXX11
469 # define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_LDBL
470 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_LDBL
471 # define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_LDBL
474 #endif // _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && IEEE128
476 // Debug Mode implies checking assertions.
477 #if defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_ASSERTIONS)
478 # define _GLIBCXX_ASSERTIONS 1
481 // Disable std::string explicit instantiation declarations in order to assert.
482 #ifdef _GLIBCXX_ASSERTIONS
483 # undef _GLIBCXX_EXTERN_TEMPLATE
484 # define _GLIBCXX_EXTERN_TEMPLATE -1
488 #if defined(_GLIBCXX_ASSERTIONS) \
489 || defined(_GLIBCXX_PARALLEL) || defined(_GLIBCXX_PARALLEL_ASSERTIONS)
492 // Avoid the use of assert, because we're trying to keep the <cassert>
493 // include out of the mix.
494 extern "C++" _GLIBCXX_NORETURN
496 __replacement_assert(const char* __file, int __line,
497 const char* __function, const char* __condition)
499 __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
500 __function, __condition);
504 #define __glibcxx_assert_impl(_Condition) \
505 if (__builtin_expect(!bool(_Condition), false)) \
506 std::__replacement_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__, \
510 #if defined(_GLIBCXX_ASSERTIONS)
511 # define __glibcxx_assert_2(_Condition) __glibcxx_assert_impl(_Condition)
513 # define __glibcxx_assert_2(_Condition)
516 // Macros for race detectors.
517 // _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) and
518 // _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) should be used to explain
519 // atomic (lock-free) synchronization to race detectors:
520 // the race detector will infer a happens-before arc from the former to the
521 // latter when they share the same argument pointer.
523 // The most frequent use case for these macros (and the only case in the
524 // current implementation of the library) is atomic reference counting:
525 // void _M_remove_reference()
527 // _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount);
528 // if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0)
530 // _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount);
534 // The annotations in this example tell the race detector that all memory
535 // accesses occurred when the refcount was positive do not race with
536 // memory accesses which occurred after the refcount became zero.
537 #ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE
538 # define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A)
540 #ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER
541 # define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A)
544 // Macros for C linkage: define extern "C" linkage only when using C++.
545 # define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
546 # define _GLIBCXX_END_EXTERN_C }
548 #define _GLIBCXX_USE_ALLOCATOR_NEW
550 #ifdef __SIZEOF_INT128__
551 #if ! defined __GLIBCXX_TYPE_INT_N_0 && ! defined __STRICT_ANSI__
552 // If __int128 is supported, we expect __GLIBCXX_TYPE_INT_N_0 to be defined
553 // unless the compiler is in strict mode. If it's not defined and the strict
554 // macro is not defined, something is wrong.
555 #warning "__STRICT_ANSI__ seems to have been undefined; this is not supported"
559 #else // !__cplusplus
560 # define _GLIBCXX_BEGIN_EXTERN_C
561 # define _GLIBCXX_END_EXTERN_C
567 // Pick up any OS-specific definitions.
568 #include <bits/os_defines.h>
570 // Pick up any CPU-specific definitions.
571 #include <bits/cpu_defines.h>
573 // If platform uses neither visibility nor psuedo-visibility,
574 // specify empty default for namespace annotation macros.
575 #ifndef _GLIBCXX_PSEUDO_VISIBILITY
576 # define _GLIBCXX_PSEUDO_VISIBILITY(V)
579 // Certain function definitions that are meant to be overridable from
580 // user code are decorated with this macro. For some targets, this
581 // macro causes these definitions to be weak.
582 #ifndef _GLIBCXX_WEAK_DEFINITION
583 # define _GLIBCXX_WEAK_DEFINITION
586 // By default, we assume that __GXX_WEAK__ also means that there is support
587 // for declaring functions as weak while not defining such functions. This
588 // allows for referring to functions provided by other libraries (e.g.,
589 // libitm) without depending on them if the respective features are not used.
590 #ifndef _GLIBCXX_USE_WEAK_REF
591 # define _GLIBCXX_USE_WEAK_REF __GXX_WEAK__
594 // Conditionally enable annotations for the Transactional Memory TS on C++11.
595 // Most of the following conditions are due to limitations in the current
597 #if __cplusplus >= 201103L && _GLIBCXX_USE_CXX11_ABI \
598 && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201500L \
599 && !_GLIBCXX_FULLY_DYNAMIC_STRING && _GLIBCXX_USE_WEAK_REF \
600 && _GLIBCXX_USE_ALLOCATOR_NEW
601 #define _GLIBCXX_TXN_SAFE transaction_safe
602 #define _GLIBCXX_TXN_SAFE_DYN transaction_safe_dynamic
604 #define _GLIBCXX_TXN_SAFE
605 #define _GLIBCXX_TXN_SAFE_DYN
608 #if __cplusplus > 201402L
609 // In C++17 mathematical special functions are in namespace std.
610 # define _GLIBCXX_USE_STD_SPEC_FUNCS 1
611 #elif __cplusplus >= 201103L && __STDCPP_WANT_MATH_SPEC_FUNCS__ != 0
612 // For C++11 and C++14 they are in namespace std when requested.
613 # define _GLIBCXX_USE_STD_SPEC_FUNCS 1
616 // The remainder of the prewritten config is automatic; all the
617 // user hooks are listed above.
619 // Create a boolean flag to be used to determine if --fast-math is set.
621 # define _GLIBCXX_FAST_MATH 1
623 # define _GLIBCXX_FAST_MATH 0
626 // This marks string literals in header files to be extracted for eventual
627 // translation. It is primarily used for messages in thrown exceptions; see
628 // src/functexcept.cc. We use __N because the more traditional _N is used
629 // for something else under certain OSes (see BADNAMES).
630 #define __N(msgid) (msgid)
632 // For example, <windows.h> is known to #define min and max as macros...
636 // N.B. these _GLIBCXX_USE_C99_XXX macros are defined unconditionally
637 // so they should be tested with #if not with #ifdef.
638 #if __cplusplus >= 201103L
639 # ifndef _GLIBCXX_USE_C99_MATH
640 # define _GLIBCXX_USE_C99_MATH _GLIBCXX11_USE_C99_MATH
642 # ifndef _GLIBCXX_USE_C99_COMPLEX
643 # define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX11_USE_C99_COMPLEX
645 # ifndef _GLIBCXX_USE_C99_STDIO
646 # define _GLIBCXX_USE_C99_STDIO _GLIBCXX11_USE_C99_STDIO
648 # ifndef _GLIBCXX_USE_C99_STDLIB
649 # define _GLIBCXX_USE_C99_STDLIB _GLIBCXX11_USE_C99_STDLIB
651 # ifndef _GLIBCXX_USE_C99_WCHAR
652 # define _GLIBCXX_USE_C99_WCHAR _GLIBCXX11_USE_C99_WCHAR
655 # ifndef _GLIBCXX_USE_C99_MATH
656 # define _GLIBCXX_USE_C99_MATH _GLIBCXX98_USE_C99_MATH
658 # ifndef _GLIBCXX_USE_C99_COMPLEX
659 # define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX98_USE_C99_COMPLEX
661 # ifndef _GLIBCXX_USE_C99_STDIO
662 # define _GLIBCXX_USE_C99_STDIO _GLIBCXX98_USE_C99_STDIO
664 # ifndef _GLIBCXX_USE_C99_STDLIB
665 # define _GLIBCXX_USE_C99_STDLIB _GLIBCXX98_USE_C99_STDLIB
667 # ifndef _GLIBCXX_USE_C99_WCHAR
668 # define _GLIBCXX_USE_C99_WCHAR _GLIBCXX98_USE_C99_WCHAR
672 // Unless explicitly specified, enable char8_t extensions only if the core
673 // language char8_t feature macro is defined.
674 #ifndef _GLIBCXX_USE_CHAR8_T
675 # ifdef __cpp_char8_t
676 # define _GLIBCXX_USE_CHAR8_T 1
679 #ifdef _GLIBCXX_USE_CHAR8_T
680 # define __cpp_lib_char8_t 201907L
683 /* Define if __float128 is supported on this host. */
684 #if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
685 /* For powerpc64 don't use __float128 when it's the same type as long double. */
686 # if !(defined(_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT) && defined(__LONG_DOUBLE_IEEE128__))
687 # define _GLIBCXX_USE_FLOAT128
691 // Define if float has the IEEE binary32 format.
692 #if __FLT_MANT_DIG__ == 24 \
693 && __FLT_MIN_EXP__ == -125 \
694 && __FLT_MAX_EXP__ == 128
695 # define _GLIBCXX_FLOAT_IS_IEEE_BINARY32 1
698 // Define if double has the IEEE binary64 format.
699 #if __DBL_MANT_DIG__ == 53 \
700 && __DBL_MIN_EXP__ == -1021 \
701 && __DBL_MAX_EXP__ == 1024
702 # define _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 1
706 # ifdef __is_identifier
707 // Intel and older Clang require !__is_identifier for some built-ins:
708 # define _GLIBCXX_HAS_BUILTIN(B) __has_builtin(B) || ! __is_identifier(B)
710 # define _GLIBCXX_HAS_BUILTIN(B) __has_builtin(B)
714 #if _GLIBCXX_HAS_BUILTIN(__has_unique_object_representations)
715 # define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1
718 #if _GLIBCXX_HAS_BUILTIN(__is_aggregate)
719 # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
722 #if _GLIBCXX_HAS_BUILTIN(__builtin_is_constant_evaluated)
723 # define _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED 1
726 #if _GLIBCXX_HAS_BUILTIN(__is_same)
727 # define _GLIBCXX_HAVE_BUILTIN_IS_SAME 1
730 #if _GLIBCXX_HAS_BUILTIN(__builtin_launder)
731 # define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
734 #undef _GLIBCXX_HAS_BUILTIN
736 #if _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED && __cplusplus >= 201402L
737 # define __glibcxx_assert_1(_Condition) \
738 if (__builtin_is_constant_evaluated()) \
740 void __failed_assertion(); \
741 if (!bool(_Condition)) \
742 __failed_assertion(); \
746 # define __glibcxx_assert_1(_Condition)
749 # define __glibcxx_assert(_Condition) \
751 __glibcxx_assert_1(_Condition) \
752 { __glibcxx_assert_2(_Condition); } \
756 // PSTL configuration
758 #if __cplusplus >= 201703L
759 // This header is not installed for freestanding:
760 #if __has_include(<pstl/pstl_config.h>)
761 // Preserved here so we have some idea which version of upstream we've pulled in
762 // #define PSTL_VERSION 9000
764 // For now this defaults to being based on the presence of Thread Building Blocks
765 # ifndef _GLIBCXX_USE_TBB_PAR_BACKEND
766 # define _GLIBCXX_USE_TBB_PAR_BACKEND __has_include(<tbb/tbb.h>)
768 // This section will need some rework when a new (default) backend type is added
769 # if _GLIBCXX_USE_TBB_PAR_BACKEND
770 # define _PSTL_PAR_BACKEND_TBB
772 # define _PSTL_PAR_BACKEND_SERIAL
775 # define _PSTL_ASSERT(_Condition) __glibcxx_assert(_Condition)
776 # define _PSTL_ASSERT_MSG(_Condition, _Message) __glibcxx_assert(_Condition)
778 #include <pstl/pstl_config.h>
779 #endif // __has_include
782 // End of prewritten config; the settings discovered at configure time follow.