1// Predefined symbols and macros -*- C++ -*- 2 3// Copyright (C) 1997-2021 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*/ 278namespace 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 300namespace std 301{ 302 inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } 303} 304namespace __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 327namespace std 328{ 329inline _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 343namespace __gnu_cxx 344{ 345inline _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) 356namespace 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 429// Define if compatibility should be provided for alternative 128-bit long 430// double formats. Not possible for Clang until __ibm128 is supported. 431#ifndef __clang__ 432#undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT 433#endif 434 435// Inline namespaces for long double 128 modes. 436#if defined _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT \ 437 && defined __LONG_DOUBLE_IEEE128__ 438namespace std 439{ 440 // Namespaces for 128-bit IEEE long double format on 64-bit POWER LE. 441 inline namespace __gnu_cxx_ieee128 { } 442 inline namespace __gnu_cxx11_ieee128 { } 443} 444# define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ieee128:: 445# define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ieee128 { 446# define _GLIBCXX_END_NAMESPACE_LDBL } 447# define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 __gnu_cxx11_ieee128:: 448# define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 namespace __gnu_cxx11_ieee128 { 449# define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 } 450 451#else // _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && IEEE128 452 453#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ 454namespace std 455{ 456 inline namespace __gnu_cxx_ldbl128 { } 457} 458# define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ldbl128:: 459# define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ldbl128 { 460# define _GLIBCXX_END_NAMESPACE_LDBL } 461#else 462# define _GLIBCXX_NAMESPACE_LDBL 463# define _GLIBCXX_BEGIN_NAMESPACE_LDBL 464# define _GLIBCXX_END_NAMESPACE_LDBL 465#endif 466 467#if _GLIBCXX_USE_CXX11_ABI 468# define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_CXX11 469# define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_CXX11 470# define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_CXX11 471#else 472# define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_LDBL 473# define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_LDBL 474# define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_LDBL 475#endif 476 477#endif // _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT && IEEE128 478 479// Debug Mode implies checking assertions. 480#if defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_ASSERTIONS) 481# define _GLIBCXX_ASSERTIONS 1 482#endif 483 484// Disable std::string explicit instantiation declarations in order to assert. 485#ifdef _GLIBCXX_ASSERTIONS 486# undef _GLIBCXX_EXTERN_TEMPLATE 487# define _GLIBCXX_EXTERN_TEMPLATE -1 488#endif 489 490 491#if __has_builtin(__builtin_is_constant_evaluated) 492# define __glibcxx_constexpr_assert(cond) \ 493 if (__builtin_is_constant_evaluated() && !bool(cond)) \ 494 __builtin_unreachable() /* precondition violation detected! */ 495#else 496# define __glibcxx_constexpr_assert(unevaluated) 497#endif 498 499 500// Assert. 501#if defined(_GLIBCXX_ASSERTIONS) \ 502 || defined(_GLIBCXX_PARALLEL) || defined(_GLIBCXX_PARALLEL_ASSERTIONS) 503namespace std 504{ 505 // Avoid the use of assert, because we're trying to keep the <cassert> 506 // include out of the mix. 507 extern "C++" _GLIBCXX_NORETURN 508 inline void 509 __replacement_assert(const char* __file, int __line, 510 const char* __function, const char* __condition) 511 { 512 __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line, 513 __function, __condition); 514 __builtin_abort(); 515 } 516} 517#define __glibcxx_assert_impl(_Condition) \ 518 if (__builtin_expect(!bool(_Condition), false)) \ 519 { \ 520 __glibcxx_constexpr_assert(_Condition); \ 521 std::__replacement_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__, \ 522 #_Condition); \ 523 } 524#endif 525 526#if defined(_GLIBCXX_ASSERTIONS) 527# define __glibcxx_assert(cond) \ 528 do { __glibcxx_assert_impl(cond); } while (false) 529#else 530# define __glibcxx_assert(cond) \ 531 do { __glibcxx_constexpr_assert(cond); } while (false) 532#endif 533 534// Macros for race detectors. 535// _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) and 536// _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) should be used to explain 537// atomic (lock-free) synchronization to race detectors: 538// the race detector will infer a happens-before arc from the former to the 539// latter when they share the same argument pointer. 540// 541// The most frequent use case for these macros (and the only case in the 542// current implementation of the library) is atomic reference counting: 543// void _M_remove_reference() 544// { 545// _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount); 546// if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0) 547// { 548// _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount); 549// _M_destroy(__a); 550// } 551// } 552// The annotations in this example tell the race detector that all memory 553// accesses occurred when the refcount was positive do not race with 554// memory accesses which occurred after the refcount became zero. 555#ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE 556# define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) 557#endif 558#ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER 559# define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) 560#endif 561 562// Macros for C linkage: define extern "C" linkage only when using C++. 563# define _GLIBCXX_BEGIN_EXTERN_C extern "C" { 564# define _GLIBCXX_END_EXTERN_C } 565 566#define _GLIBCXX_USE_ALLOCATOR_NEW 567 568#ifdef __SIZEOF_INT128__ 569#if ! defined __GLIBCXX_TYPE_INT_N_0 && ! defined __STRICT_ANSI__ 570// If __int128 is supported, we expect __GLIBCXX_TYPE_INT_N_0 to be defined 571// unless the compiler is in strict mode. If it's not defined and the strict 572// macro is not defined, something is wrong. 573#warning "__STRICT_ANSI__ seems to have been undefined; this is not supported" 574#endif 575#endif 576 577#else // !__cplusplus 578# define _GLIBCXX_BEGIN_EXTERN_C 579# define _GLIBCXX_END_EXTERN_C 580#endif 581 582 583// First includes. 584 585// Pick up any OS-specific definitions. 586#include <bits/os_defines.h> 587 588// Pick up any CPU-specific definitions. 589#include <bits/cpu_defines.h> 590 591// If platform uses neither visibility nor psuedo-visibility, 592// specify empty default for namespace annotation macros. 593#ifndef _GLIBCXX_PSEUDO_VISIBILITY 594# define _GLIBCXX_PSEUDO_VISIBILITY(V) 595#endif 596 597// Certain function definitions that are meant to be overridable from 598// user code are decorated with this macro. For some targets, this 599// macro causes these definitions to be weak. 600#ifndef _GLIBCXX_WEAK_DEFINITION 601# define _GLIBCXX_WEAK_DEFINITION 602#endif 603 604// By default, we assume that __GXX_WEAK__ also means that there is support 605// for declaring functions as weak while not defining such functions. This 606// allows for referring to functions provided by other libraries (e.g., 607// libitm) without depending on them if the respective features are not used. 608#ifndef _GLIBCXX_USE_WEAK_REF 609# define _GLIBCXX_USE_WEAK_REF __GXX_WEAK__ 610#endif 611 612// Conditionally enable annotations for the Transactional Memory TS on C++11. 613// Most of the following conditions are due to limitations in the current 614// implementation. 615#if __cplusplus >= 201103L && _GLIBCXX_USE_CXX11_ABI \ 616 && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201500L \ 617 && !_GLIBCXX_FULLY_DYNAMIC_STRING && _GLIBCXX_USE_WEAK_REF \ 618 && _GLIBCXX_USE_ALLOCATOR_NEW 619#define _GLIBCXX_TXN_SAFE transaction_safe 620#define _GLIBCXX_TXN_SAFE_DYN transaction_safe_dynamic 621#else 622#define _GLIBCXX_TXN_SAFE 623#define _GLIBCXX_TXN_SAFE_DYN 624#endif 625 626#if __cplusplus > 201402L 627// In C++17 mathematical special functions are in namespace std. 628# define _GLIBCXX_USE_STD_SPEC_FUNCS 1 629#elif __cplusplus >= 201103L && __STDCPP_WANT_MATH_SPEC_FUNCS__ != 0 630// For C++11 and C++14 they are in namespace std when requested. 631# define _GLIBCXX_USE_STD_SPEC_FUNCS 1 632#endif 633 634// The remainder of the prewritten config is automatic; all the 635// user hooks are listed above. 636 637// Create a boolean flag to be used to determine if --fast-math is set. 638#ifdef __FAST_MATH__ 639# define _GLIBCXX_FAST_MATH 1 640#else 641# define _GLIBCXX_FAST_MATH 0 642#endif 643 644// This marks string literals in header files to be extracted for eventual 645// translation. It is primarily used for messages in thrown exceptions; see 646// src/functexcept.cc. We use __N because the more traditional _N is used 647// for something else under certain OSes (see BADNAMES). 648#define __N(msgid) (msgid) 649 650// For example, <windows.h> is known to #define min and max as macros... 651#undef min 652#undef max 653 654// N.B. these _GLIBCXX_USE_C99_XXX macros are defined unconditionally 655// so they should be tested with #if not with #ifdef. 656#if __cplusplus >= 201103L 657# ifndef _GLIBCXX_USE_C99_MATH 658# define _GLIBCXX_USE_C99_MATH _GLIBCXX11_USE_C99_MATH 659# endif 660# ifndef _GLIBCXX_USE_C99_COMPLEX 661# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX11_USE_C99_COMPLEX 662# endif 663# ifndef _GLIBCXX_USE_C99_STDIO 664# define _GLIBCXX_USE_C99_STDIO _GLIBCXX11_USE_C99_STDIO 665# endif 666# ifndef _GLIBCXX_USE_C99_STDLIB 667# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX11_USE_C99_STDLIB 668# endif 669# ifndef _GLIBCXX_USE_C99_WCHAR 670# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX11_USE_C99_WCHAR 671# endif 672#else 673# ifndef _GLIBCXX_USE_C99_MATH 674# define _GLIBCXX_USE_C99_MATH _GLIBCXX98_USE_C99_MATH 675# endif 676# ifndef _GLIBCXX_USE_C99_COMPLEX 677# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX98_USE_C99_COMPLEX 678# endif 679# ifndef _GLIBCXX_USE_C99_STDIO 680# define _GLIBCXX_USE_C99_STDIO _GLIBCXX98_USE_C99_STDIO 681# endif 682# ifndef _GLIBCXX_USE_C99_STDLIB 683# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX98_USE_C99_STDLIB 684# endif 685# ifndef _GLIBCXX_USE_C99_WCHAR 686# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX98_USE_C99_WCHAR 687# endif 688#endif 689 690// Unless explicitly specified, enable char8_t extensions only if the core 691// language char8_t feature macro is defined. 692#ifndef _GLIBCXX_USE_CHAR8_T 693# ifdef __cpp_char8_t 694# define _GLIBCXX_USE_CHAR8_T 1 695# endif 696#endif 697#ifdef _GLIBCXX_USE_CHAR8_T 698# define __cpp_lib_char8_t 201907L 699#endif 700 701/* Define if __float128 is supported on this host. */ 702#if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__) 703/* For powerpc64 don't use __float128 when it's the same type as long double. */ 704# if !(defined(_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT) && defined(__LONG_DOUBLE_IEEE128__)) 705# define _GLIBCXX_USE_FLOAT128 706# endif 707#endif 708 709// Define if float has the IEEE binary32 format. 710#if __FLT_MANT_DIG__ == 24 \ 711 && __FLT_MIN_EXP__ == -125 \ 712 && __FLT_MAX_EXP__ == 128 713# define _GLIBCXX_FLOAT_IS_IEEE_BINARY32 1 714#endif 715 716// Define if double has the IEEE binary64 format. 717#if __DBL_MANT_DIG__ == 53 \ 718 && __DBL_MIN_EXP__ == -1021 \ 719 && __DBL_MAX_EXP__ == 1024 720# define _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 1 721#endif 722 723#ifdef __has_builtin 724# ifdef __is_identifier 725// Intel and older Clang require !__is_identifier for some built-ins: 726# define _GLIBCXX_HAS_BUILTIN(B) __has_builtin(B) || ! __is_identifier(B) 727# else 728# define _GLIBCXX_HAS_BUILTIN(B) __has_builtin(B) 729# endif 730#endif 731 732#if _GLIBCXX_HAS_BUILTIN(__has_unique_object_representations) 733# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 734#endif 735 736#if _GLIBCXX_HAS_BUILTIN(__is_aggregate) 737# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 738#endif 739 740#if _GLIBCXX_HAS_BUILTIN(__builtin_is_constant_evaluated) 741# define _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED 1 742#endif 743 744#if _GLIBCXX_HAS_BUILTIN(__is_same) 745# define _GLIBCXX_HAVE_BUILTIN_IS_SAME 1 746#endif 747 748#if _GLIBCXX_HAS_BUILTIN(__builtin_launder) 749# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1 750#endif 751 752#undef _GLIBCXX_HAS_BUILTIN 753 754 755// PSTL configuration 756 757#if __cplusplus >= 201703L 758// This header is not installed for freestanding: 759#if __has_include(<pstl/pstl_config.h>) 760// Preserved here so we have some idea which version of upstream we've pulled in 761// #define PSTL_VERSION 9000 762 763// For now this defaults to being based on the presence of Thread Building Blocks 764# ifndef _GLIBCXX_USE_TBB_PAR_BACKEND 765# define _GLIBCXX_USE_TBB_PAR_BACKEND __has_include(<tbb/tbb.h>) 766# endif 767// This section will need some rework when a new (default) backend type is added 768# if _GLIBCXX_USE_TBB_PAR_BACKEND 769# define _PSTL_PAR_BACKEND_TBB 770# else 771# define _PSTL_PAR_BACKEND_SERIAL 772# endif 773 774# define _PSTL_ASSERT(_Condition) __glibcxx_assert(_Condition) 775# define _PSTL_ASSERT_MSG(_Condition, _Message) __glibcxx_assert(_Condition) 776 777#include <pstl/pstl_config.h> 778#endif // __has_include 779#endif // C++17 780 781// End of prewritten config; the settings discovered at configure time follow. 782