libstdc++: Disable floating-point std::to_chars on unsupported targets
[platform/upstream/gcc.git] / libstdc++-v3 / include / bits / c++config
1 // Predefined symbols and macros -*- C++ -*-
2
3 // Copyright (C) 1997-2020 Free Software Foundation, Inc.
4 //
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)
9 // any later version.
10
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.
15
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.
19
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/>.
24
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}
28  */
29
30 #ifndef _GLIBCXX_CXX_CONFIG_H
31 #define _GLIBCXX_CXX_CONFIG_H 1
32
33 // The major release number for the GCC release the C++ library belongs to.
34 #define _GLIBCXX_RELEASE
35
36 // The datestamp of the C++ library in compressed ISO date format.
37 #define __GLIBCXX__
38
39 // Macros for various attributes.
40 //   _GLIBCXX_PURE
41 //   _GLIBCXX_CONST
42 //   _GLIBCXX_NORETURN
43 //   _GLIBCXX_NOTHROW
44 //   _GLIBCXX_VISIBILITY
45 #ifndef _GLIBCXX_PURE
46 # define _GLIBCXX_PURE __attribute__ ((__pure__))
47 #endif
48
49 #ifndef _GLIBCXX_CONST
50 # define _GLIBCXX_CONST __attribute__ ((__const__))
51 #endif
52
53 #ifndef _GLIBCXX_NORETURN
54 # define _GLIBCXX_NORETURN __attribute__ ((__noreturn__))
55 #endif
56
57 // See below for C++
58 #ifndef _GLIBCXX_NOTHROW
59 # ifndef __cplusplus
60 #  define _GLIBCXX_NOTHROW __attribute__((__nothrow__))
61 # endif
62 #endif
63
64 // Macros for visibility attributes.
65 //   _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
66 //   _GLIBCXX_VISIBILITY
67 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
68
69 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
70 # define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
71 #else
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)
75 #endif
76
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
89 #endif
90
91 #if defined(__DEPRECATED)
92 # define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__))
93 # define _GLIBCXX_DEPRECATED_SUGGEST(ALT) \
94   __attribute__ ((__deprecated__ ("use '" ALT "' instead")))
95 #else
96 # define _GLIBCXX_DEPRECATED
97 # define _GLIBCXX_DEPRECATED_SUGGEST(ALT)
98 #endif
99
100 #if defined(__DEPRECATED) && (__cplusplus >= 201103L)
101 # define _GLIBCXX11_DEPRECATED _GLIBCXX_DEPRECATED
102 # define _GLIBCXX11_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
103 #else
104 # define _GLIBCXX11_DEPRECATED
105 # define _GLIBCXX11_DEPRECATED_SUGGEST(ALT)
106 #endif
107
108 #if defined(__DEPRECATED) && (__cplusplus >= 201703L)
109 # define _GLIBCXX17_DEPRECATED [[__deprecated__]]
110 # define _GLIBCXX17_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
111 #else
112 # define _GLIBCXX17_DEPRECATED
113 # define _GLIBCXX17_DEPRECATED_SUGGEST(ALT)
114 #endif
115
116 #if defined(__DEPRECATED) && (__cplusplus > 201703L)
117 # define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
118 # define _GLIBCXX20_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
119 #else
120 # define _GLIBCXX20_DEPRECATED(MSG)
121 # define _GLIBCXX20_DEPRECATED_SUGGEST(ALT)
122 #endif
123
124 // Macros for ABI tag attributes.
125 #ifndef _GLIBCXX_ABI_TAG_CXX11
126 # define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
127 #endif
128
129 // Macro to warn about unused results.
130 #if __cplusplus >= 201703L
131 # define _GLIBCXX_NODISCARD [[__nodiscard__]]
132 #else
133 # define _GLIBCXX_NODISCARD
134 #endif
135
136
137
138 #if __cplusplus
139
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
145 # else
146 #  define _GLIBCXX_CONSTEXPR
147 #  define _GLIBCXX_USE_CONSTEXPR const
148 # endif
149 #endif
150
151 #ifndef _GLIBCXX14_CONSTEXPR
152 # if __cplusplus >= 201402L
153 #  define _GLIBCXX14_CONSTEXPR constexpr
154 # else
155 #  define _GLIBCXX14_CONSTEXPR
156 # endif
157 #endif
158
159 #ifndef _GLIBCXX17_CONSTEXPR
160 # if __cplusplus >= 201703L
161 #  define _GLIBCXX17_CONSTEXPR constexpr
162 # else
163 #  define _GLIBCXX17_CONSTEXPR
164 # endif
165 #endif
166
167 #ifndef _GLIBCXX20_CONSTEXPR
168 # if __cplusplus > 201703L
169 #  define _GLIBCXX20_CONSTEXPR constexpr
170 # else
171 #  define _GLIBCXX20_CONSTEXPR
172 # endif
173 #endif
174
175 #ifndef _GLIBCXX17_INLINE
176 # if __cplusplus >= 201703L
177 #  define _GLIBCXX17_INLINE inline
178 # else
179 #  define _GLIBCXX17_INLINE
180 # endif
181 #endif
182
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)
190 # else
191 #  define _GLIBCXX_NOEXCEPT
192 #  define _GLIBCXX_NOEXCEPT_IF(...)
193 #  define _GLIBCXX_USE_NOEXCEPT throw()
194 #  define _GLIBCXX_THROW(_EXC) throw(_EXC)
195 # endif
196 #endif
197
198 #ifndef _GLIBCXX_NOTHROW
199 # define _GLIBCXX_NOTHROW _GLIBCXX_USE_NOEXCEPT
200 #endif
201
202 #ifndef _GLIBCXX_THROW_OR_ABORT
203 # if __cpp_exceptions
204 #  define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC))
205 # else
206 #  define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort())
207 # endif
208 #endif
209
210 #if __cpp_noexcept_function_type
211 #define _GLIBCXX_NOEXCEPT_PARM , bool _NE
212 #define _GLIBCXX_NOEXCEPT_QUAL noexcept (_NE)
213 #else
214 #define _GLIBCXX_NOEXCEPT_PARM
215 #define _GLIBCXX_NOEXCEPT_QUAL
216 #endif
217
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
229
230 /*
231   Outline of libstdc++ namespaces.
232
233   namespace std
234   {
235     namespace __debug { }
236     namespace __parallel { }
237     namespace __cxx1998 { }
238
239     namespace __detail {
240       namespace __variant { }                           // C++17
241     }
242
243     namespace rel_ops { }
244
245     namespace tr1
246     {
247       namespace placeholders { }
248       namespace regex_constants { }
249       namespace __detail { }
250     }
251
252     namespace tr2 { }
253     
254     namespace decimal { }
255
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
265     }
266   }
267
268   namespace abi { }
269
270   namespace __gnu_cxx
271   {
272     namespace __detail { }
273   }
274
275   For full details see:
276   http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html
277 */
278 namespace std
279 {
280   typedef __SIZE_TYPE__         size_t;
281   typedef __PTRDIFF_TYPE__      ptrdiff_t;
282
283 #if __cplusplus >= 201103L
284   typedef decltype(nullptr)     nullptr_t;
285 #endif
286 }
287
288 #define _GLIBCXX_USE_DUAL_ABI
289
290 #if ! _GLIBCXX_USE_DUAL_ABI
291 // Ignore any pre-defined value of _GLIBCXX_USE_CXX11_ABI
292 # undef _GLIBCXX_USE_CXX11_ABI
293 #endif
294
295 #ifndef _GLIBCXX_USE_CXX11_ABI
296 #define _GLIBCXX_USE_CXX11_ABI
297 #endif
298
299 #if _GLIBCXX_USE_CXX11_ABI
300 namespace std
301 {
302   inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
303 }
304 namespace __gnu_cxx
305 {
306   inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
307 }
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
312 #else
313 # define _GLIBCXX_NAMESPACE_CXX11
314 # define _GLIBCXX_BEGIN_NAMESPACE_CXX11
315 # define _GLIBCXX_END_NAMESPACE_CXX11
316 # define _GLIBCXX_DEFAULT_ABI_TAG
317 #endif
318
319 // Defined if inline namespaces are used for versioning.
320 #define _GLIBCXX_INLINE_VERSION 
321
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 }
326
327 namespace std
328 {
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 { }
337 #endif // C++17
338   }
339 #endif // C++14
340 _GLIBCXX_END_NAMESPACE_VERSION
341 }
342
343 namespace __gnu_cxx
344 {
345 inline _GLIBCXX_BEGIN_NAMESPACE_VERSION
346 _GLIBCXX_END_NAMESPACE_VERSION
347 }
348
349 #else
350 # define _GLIBCXX_BEGIN_NAMESPACE_VERSION
351 # define _GLIBCXX_END_NAMESPACE_VERSION
352 #endif
353
354 // Inline namespaces for special modes: debug, parallel.
355 #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
356 namespace std
357 {
358 _GLIBCXX_BEGIN_NAMESPACE_VERSION
359
360   // Non-inline namespace for components replaced by alternates in active mode.
361   namespace __cxx1998
362   {
363 # if _GLIBCXX_USE_CXX11_ABI
364   inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
365 # endif
366   }
367
368 _GLIBCXX_END_NAMESPACE_VERSION
369
370   // Inline namespace for debug mode.
371 # ifdef _GLIBCXX_DEBUG
372   inline namespace __debug { }
373 # endif
374
375   // Inline namespaces for parallel mode.
376 # ifdef _GLIBCXX_PARALLEL
377   inline namespace __parallel { }
378 # endif
379 }
380
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
384 # endif
385
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
390 # endif
391 #endif
392
393 // Macros for namespace scope. Either namespace std:: or the name
394 // of some nested namespace within it corresponding to the active mode.
395 // _GLIBCXX_STD_A
396 // _GLIBCXX_STD_C
397 //
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 }
408 #else
409 # define _GLIBCXX_STD_C std
410 # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
411 # define _GLIBCXX_END_NAMESPACE_CONTAINER
412 #endif
413
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 }
419 #else
420 # define _GLIBCXX_STD_A std
421 # define _GLIBCXX_BEGIN_NAMESPACE_ALGO
422 # define _GLIBCXX_END_NAMESPACE_ALGO
423 #endif
424
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
429 // double formats.
430 #undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
431
432 // Inline namespaces for long double 128 modes.
433 #if defined _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT \
434   && defined __LONG_DOUBLE_IEEE128__
435 namespace std
436 {
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 { }
440 }
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 }
447
448 #else // _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && IEEE128
449
450 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
451 namespace std
452 {
453   inline namespace __gnu_cxx_ldbl128 { }
454 }
455 # define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ldbl128::
456 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ldbl128 {
457 # define _GLIBCXX_END_NAMESPACE_LDBL }
458 #else
459 # define _GLIBCXX_NAMESPACE_LDBL
460 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL
461 # define _GLIBCXX_END_NAMESPACE_LDBL
462 #endif
463
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
468 #else
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
472 #endif
473
474 #endif // _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && IEEE128
475
476 // Debug Mode implies checking assertions.
477 #if defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_ASSERTIONS)
478 # define _GLIBCXX_ASSERTIONS 1
479 #endif
480
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
485 #endif
486
487 // Assert.
488 #if defined(_GLIBCXX_ASSERTIONS) \
489   || defined(_GLIBCXX_PARALLEL) || defined(_GLIBCXX_PARALLEL_ASSERTIONS)
490 namespace std
491 {
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
495   inline void
496   __replacement_assert(const char* __file, int __line,
497                        const char* __function, const char* __condition)
498   {
499     __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
500                      __function, __condition);
501     __builtin_abort();
502   }
503 }
504 #define __glibcxx_assert_impl(_Condition)                              \
505   if (__builtin_expect(!bool(_Condition), false))                      \
506     std::__replacement_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__, \
507                               #_Condition)
508 #endif
509
510 #if defined(_GLIBCXX_ASSERTIONS)
511 # define __glibcxx_assert_2(_Condition) __glibcxx_assert_impl(_Condition)
512 #else
513 # define __glibcxx_assert_2(_Condition)
514 #endif
515
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.
522 //
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()
526 //   {
527 //     _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount);
528 //     if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0)
529 //       {
530 //         _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount);
531 //         _M_destroy(__a);
532 //       }
533 //   }
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)
539 #endif
540 #ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER
541 # define  _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A)
542 #endif
543
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 }
547
548 #define _GLIBCXX_USE_ALLOCATOR_NEW
549
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"
556 #endif
557 #endif
558
559 #else // !__cplusplus
560 # define _GLIBCXX_BEGIN_EXTERN_C
561 # define _GLIBCXX_END_EXTERN_C
562 #endif
563
564
565 // First includes.
566
567 // Pick up any OS-specific definitions.
568 #include <bits/os_defines.h>
569
570 // Pick up any CPU-specific definitions.
571 #include <bits/cpu_defines.h>
572
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)
577 #endif
578
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
584 #endif
585
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__
592 #endif
593
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
596 // implementation.
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
603 #else
604 #define _GLIBCXX_TXN_SAFE
605 #define _GLIBCXX_TXN_SAFE_DYN
606 #endif
607
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
614 #endif
615
616 // The remainder of the prewritten config is automatic; all the
617 // user hooks are listed above.
618
619 // Create a boolean flag to be used to determine if --fast-math is set.
620 #ifdef __FAST_MATH__
621 # define _GLIBCXX_FAST_MATH 1
622 #else
623 # define _GLIBCXX_FAST_MATH 0
624 #endif
625
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)
631
632 // For example, <windows.h> is known to #define min and max as macros...
633 #undef min
634 #undef max
635
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
641 # endif
642 # ifndef _GLIBCXX_USE_C99_COMPLEX
643 # define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX11_USE_C99_COMPLEX
644 # endif
645 # ifndef _GLIBCXX_USE_C99_STDIO
646 # define _GLIBCXX_USE_C99_STDIO _GLIBCXX11_USE_C99_STDIO
647 # endif
648 # ifndef _GLIBCXX_USE_C99_STDLIB
649 # define _GLIBCXX_USE_C99_STDLIB _GLIBCXX11_USE_C99_STDLIB
650 # endif
651 # ifndef _GLIBCXX_USE_C99_WCHAR
652 # define _GLIBCXX_USE_C99_WCHAR _GLIBCXX11_USE_C99_WCHAR
653 # endif
654 #else
655 # ifndef _GLIBCXX_USE_C99_MATH
656 #  define _GLIBCXX_USE_C99_MATH _GLIBCXX98_USE_C99_MATH
657 # endif
658 # ifndef _GLIBCXX_USE_C99_COMPLEX
659 # define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX98_USE_C99_COMPLEX
660 # endif
661 # ifndef _GLIBCXX_USE_C99_STDIO
662 # define _GLIBCXX_USE_C99_STDIO _GLIBCXX98_USE_C99_STDIO
663 # endif
664 # ifndef _GLIBCXX_USE_C99_STDLIB
665 # define _GLIBCXX_USE_C99_STDLIB _GLIBCXX98_USE_C99_STDLIB
666 # endif
667 # ifndef _GLIBCXX_USE_C99_WCHAR
668 # define _GLIBCXX_USE_C99_WCHAR _GLIBCXX98_USE_C99_WCHAR
669 # endif
670 #endif
671
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
677 # endif
678 #endif
679 #ifdef _GLIBCXX_USE_CHAR8_T
680 # define __cpp_lib_char8_t 201907L
681 #endif
682
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
688 # endif
689 #endif
690
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
696 #endif
697
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
703 #endif
704
705 #ifdef __has_builtin
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)
709 # else
710 #  define _GLIBCXX_HAS_BUILTIN(B) __has_builtin(B)
711 # endif
712 #endif
713
714 #if _GLIBCXX_HAS_BUILTIN(__has_unique_object_representations)
715 # define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1
716 #endif
717
718 #if _GLIBCXX_HAS_BUILTIN(__is_aggregate)
719 # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
720 #endif
721
722 #if _GLIBCXX_HAS_BUILTIN(__builtin_is_constant_evaluated)
723 #  define _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED 1
724 #endif
725
726 #if _GLIBCXX_HAS_BUILTIN(__is_same)
727 #  define _GLIBCXX_HAVE_BUILTIN_IS_SAME 1
728 #endif
729
730 #if _GLIBCXX_HAS_BUILTIN(__builtin_launder)
731 # define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
732 #endif
733
734 #undef _GLIBCXX_HAS_BUILTIN
735
736 #if _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED && __cplusplus >= 201402L
737 # define __glibcxx_assert_1(_Condition)         \
738     if (__builtin_is_constant_evaluated())      \
739      {                                          \
740        void __failed_assertion();       \
741        if (!bool(_Condition))                   \
742          __failed_assertion();  \
743      }                                          \
744     else
745 #else
746 # define __glibcxx_assert_1(_Condition)
747 #endif
748
749 # define __glibcxx_assert(_Condition)     \
750   do {                                    \
751     __glibcxx_assert_1(_Condition)        \
752     { __glibcxx_assert_2(_Condition); }   \
753   } while (false)
754
755
756 // PSTL configuration
757
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
763
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>)
767 # endif
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
771 # else
772 #  define _PSTL_PAR_BACKEND_SERIAL
773 # endif
774
775 # define _PSTL_ASSERT(_Condition) __glibcxx_assert(_Condition)
776 # define _PSTL_ASSERT_MSG(_Condition, _Message) __glibcxx_assert(_Condition)
777
778 #include <pstl/pstl_config.h>
779 #endif // __has_include
780 #endif // C++17
781
782 // End of prewritten config; the settings discovered at configure time follow.