1// -*- C++ -*- 2//===--------------------------- __config ---------------------------------===// 3// 4// The LLVM Compiler Infrastructure 5// 6// This file is dual licensed under the MIT and the University of Illinois Open 7// Source Licenses. See LICENSE.TXT for details. 8// 9//===----------------------------------------------------------------------===// 10 11#ifndef _LIBCPP_CONFIG 12#define _LIBCPP_CONFIG 13 14#if defined(_MSC_VER) && !defined(__clang__) 15#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER 16#endif 17 18#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER 19#pragma GCC system_header 20#endif 21 22#ifdef __cplusplus 23 24#ifdef __GNUC__ 25#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) 26#else 27#define _GNUC_VER 0 28#endif 29 30#define _LIBCPP_VERSION 3800 31 32#ifndef _LIBCPP_ABI_VERSION 33#define _LIBCPP_ABI_VERSION 1 34#endif 35 36#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2 37// Change short string represention so that string data starts at offset 0, 38// improving its alignment in some cases. 39#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT 40// Fix deque iterator type in order to support incomplete types. 41#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE 42#endif 43 44#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y 45#define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) 46 47#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION) 48 49 50#ifndef __has_attribute 51#define __has_attribute(__x) 0 52#endif 53#ifndef __has_builtin 54#define __has_builtin(__x) 0 55#endif 56#ifndef __has_extension 57#define __has_extension(__x) 0 58#endif 59#ifndef __has_feature 60#define __has_feature(__x) 0 61#endif 62// '__is_identifier' returns '0' if '__x' is a reserved identifier provided by 63// the compiler and '1' otherwise. 64#ifndef __is_identifier 65#define __is_identifier(__x) 1 66#endif 67 68 69#ifdef __LITTLE_ENDIAN__ 70#if __LITTLE_ENDIAN__ 71#define _LIBCPP_LITTLE_ENDIAN 1 72#define _LIBCPP_BIG_ENDIAN 0 73#endif // __LITTLE_ENDIAN__ 74#endif // __LITTLE_ENDIAN__ 75 76#ifdef __BIG_ENDIAN__ 77#if __BIG_ENDIAN__ 78#define _LIBCPP_LITTLE_ENDIAN 0 79#define _LIBCPP_BIG_ENDIAN 1 80#endif // __BIG_ENDIAN__ 81#endif // __BIG_ENDIAN__ 82 83#ifdef __BYTE_ORDER__ 84#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 85#define _LIBCPP_LITTLE_ENDIAN 1 86#define _LIBCPP_BIG_ENDIAN 0 87#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 88#define _LIBCPP_LITTLE_ENDIAN 0 89#define _LIBCPP_BIG_ENDIAN 1 90#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 91#endif // __BYTE_ORDER__ 92 93#ifdef __FreeBSD__ 94# include <sys/endian.h> 95# if _BYTE_ORDER == _LITTLE_ENDIAN 96# define _LIBCPP_LITTLE_ENDIAN 1 97# define _LIBCPP_BIG_ENDIAN 0 98# else // _BYTE_ORDER == _LITTLE_ENDIAN 99# define _LIBCPP_LITTLE_ENDIAN 0 100# define _LIBCPP_BIG_ENDIAN 1 101# endif // _BYTE_ORDER == _LITTLE_ENDIAN 102# ifndef __LONG_LONG_SUPPORTED 103# define _LIBCPP_HAS_NO_LONG_LONG 104# endif // __LONG_LONG_SUPPORTED 105#endif // __FreeBSD__ 106 107#ifdef __NetBSD__ 108# include <sys/endian.h> 109# if _BYTE_ORDER == _LITTLE_ENDIAN 110# define _LIBCPP_LITTLE_ENDIAN 1 111# define _LIBCPP_BIG_ENDIAN 0 112# else // _BYTE_ORDER == _LITTLE_ENDIAN 113# define _LIBCPP_LITTLE_ENDIAN 0 114# define _LIBCPP_BIG_ENDIAN 1 115# endif // _BYTE_ORDER == _LITTLE_ENDIAN 116# define _LIBCPP_HAS_QUICK_EXIT 117#endif // __NetBSD__ 118 119#ifdef _WIN32 120# define _LIBCPP_LITTLE_ENDIAN 1 121# define _LIBCPP_BIG_ENDIAN 0 122// Compiler intrinsics (MSVC) 123#if defined(_MSC_VER) && _MSC_VER >= 1400 124# define _LIBCPP_HAS_IS_BASE_OF 125# endif 126# if defined(_MSC_VER) && !defined(__clang__) 127# define _LIBCPP_MSVC // Using Microsoft Visual C++ compiler 128# define _LIBCPP_TOSTRING2(x) #x 129# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x) 130# define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x)) 131# endif 132# // If mingw not explicitly detected, assume using MS C runtime only. 133# ifndef __MINGW32__ 134# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library 135# endif 136#endif // _WIN32 137 138#ifdef __sun__ 139# include <sys/isa_defs.h> 140# ifdef _LITTLE_ENDIAN 141# define _LIBCPP_LITTLE_ENDIAN 1 142# define _LIBCPP_BIG_ENDIAN 0 143# else 144# define _LIBCPP_LITTLE_ENDIAN 0 145# define _LIBCPP_BIG_ENDIAN 1 146# endif 147#endif // __sun__ 148 149#if defined(__CloudABI__) 150 // Certain architectures provide arc4random(). Prefer using 151 // arc4random() over /dev/{u,}random to make it possible to obtain 152 // random data even when using sandboxing mechanisms such as chroots, 153 // Capsicum, etc. 154# define _LIBCPP_USING_ARC4_RANDOM 155#elif defined(__native_client__) 156 // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access, 157 // including accesses to the special files under /dev. C++11's 158 // std::random_device is instead exposed through a NaCl syscall. 159# define _LIBCPP_USING_NACL_RANDOM 160#elif defined(_WIN32) 161# define _LIBCPP_USING_WIN32_RANDOM 162#else 163# define _LIBCPP_USING_DEV_RANDOM 164#endif 165 166#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) 167# include <endian.h> 168# if __BYTE_ORDER == __LITTLE_ENDIAN 169# define _LIBCPP_LITTLE_ENDIAN 1 170# define _LIBCPP_BIG_ENDIAN 0 171# elif __BYTE_ORDER == __BIG_ENDIAN 172# define _LIBCPP_LITTLE_ENDIAN 0 173# define _LIBCPP_BIG_ENDIAN 1 174# else // __BYTE_ORDER == __BIG_ENDIAN 175# error unable to determine endian 176# endif 177#endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) 178 179#ifdef _WIN32 180 181// only really useful for a DLL 182#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally... 183# ifdef cxx_EXPORTS 184# define _LIBCPP_HIDDEN 185# define _LIBCPP_FUNC_VIS __declspec(dllexport) 186# define _LIBCPP_TYPE_VIS __declspec(dllexport) 187# else 188# define _LIBCPP_HIDDEN 189# define _LIBCPP_FUNC_VIS __declspec(dllimport) 190# define _LIBCPP_TYPE_VIS __declspec(dllimport) 191# endif 192#else 193# define _LIBCPP_HIDDEN 194# define _LIBCPP_FUNC_VIS 195# define _LIBCPP_TYPE_VIS 196#endif 197 198#define _LIBCPP_TYPE_VIS_ONLY 199#define _LIBCPP_FUNC_VIS_ONLY 200 201#ifndef _LIBCPP_INLINE_VISIBILITY 202# ifdef _LIBCPP_MSVC 203# define _LIBCPP_INLINE_VISIBILITY __forceinline 204# else // MinGW GCC and Clang 205# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__)) 206# endif 207#endif 208 209#ifndef _LIBCPP_EXCEPTION_ABI 210#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS 211#endif 212 213#ifndef _LIBCPP_ALWAYS_INLINE 214# ifdef _LIBCPP_MSVC 215# define _LIBCPP_ALWAYS_INLINE __forceinline 216# endif 217#endif 218 219#endif // _WIN32 220 221#ifndef _LIBCPP_HIDDEN 222#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) 223#endif 224 225#ifndef _LIBCPP_FUNC_VIS 226#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default"))) 227#endif 228 229#ifndef _LIBCPP_TYPE_VIS 230# if __has_attribute(__type_visibility__) 231# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) 232# else 233# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) 234# endif 235#endif 236 237#ifndef _LIBCPP_TYPE_VIS_ONLY 238# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS 239#endif 240 241#ifndef _LIBCPP_FUNC_VIS_ONLY 242# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS 243#endif 244 245#ifndef _LIBCPP_INLINE_VISIBILITY 246#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__)) 247#endif 248 249#ifndef _LIBCPP_EXCEPTION_ABI 250#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) 251#endif 252 253#ifndef _LIBCPP_ALWAYS_INLINE 254#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__)) 255#endif 256 257#if defined(__clang__) 258 259// _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for 260// _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility. 261#if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \ 262 !defined(__arm__)) || \ 263 defined(_LIBCPP_ALTERNATE_STRING_LAYOUT) 264#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT 265#endif 266 267#if __has_feature(cxx_alignas) 268# define _ALIGNAS_TYPE(x) alignas(x) 269# define _ALIGNAS(x) alignas(x) 270#else 271# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) 272# define _ALIGNAS(x) __attribute__((__aligned__(x))) 273#endif 274 275#if !__has_feature(cxx_alias_templates) 276#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES 277#endif 278 279#if __cplusplus < 201103L 280typedef __char16_t char16_t; 281typedef __char32_t char32_t; 282#endif 283 284#if !(__has_feature(cxx_exceptions)) 285#define _LIBCPP_NO_EXCEPTIONS 286#endif 287 288#if !(__has_feature(cxx_rtti)) 289#define _LIBCPP_NO_RTTI 290#endif 291 292#if !(__has_feature(cxx_strong_enums)) 293#define _LIBCPP_HAS_NO_STRONG_ENUMS 294#endif 295 296#if !(__has_feature(cxx_decltype)) 297#define _LIBCPP_HAS_NO_DECLTYPE 298#endif 299 300#if __has_feature(cxx_attributes) 301# define _LIBCPP_NORETURN [[noreturn]] 302#else 303# define _LIBCPP_NORETURN __attribute__ ((noreturn)) 304#endif 305 306#define _LIBCPP_UNUSED __attribute__((__unused__)) 307 308#if !(__has_feature(cxx_defaulted_functions)) 309#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS 310#endif // !(__has_feature(cxx_defaulted_functions)) 311 312#if !(__has_feature(cxx_deleted_functions)) 313#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS 314#endif // !(__has_feature(cxx_deleted_functions)) 315 316#if !(__has_feature(cxx_lambdas)) 317#define _LIBCPP_HAS_NO_LAMBDAS 318#endif 319 320#if !(__has_feature(cxx_nullptr)) 321#define _LIBCPP_HAS_NO_NULLPTR 322#endif 323 324#if !(__has_feature(cxx_rvalue_references)) 325#define _LIBCPP_HAS_NO_RVALUE_REFERENCES 326#endif 327 328#if !(__has_feature(cxx_static_assert)) 329#define _LIBCPP_HAS_NO_STATIC_ASSERT 330#endif 331 332#if !(__has_feature(cxx_auto_type)) 333#define _LIBCPP_HAS_NO_AUTO_TYPE 334#endif 335 336#if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return) 337#define _LIBCPP_HAS_NO_ADVANCED_SFINAE 338#endif 339 340#if !(__has_feature(cxx_variadic_templates)) 341#define _LIBCPP_HAS_NO_VARIADICS 342#endif 343 344#if !(__has_feature(cxx_trailing_return)) 345#define _LIBCPP_HAS_NO_TRAILING_RETURN 346#endif 347 348#if !(__has_feature(cxx_generalized_initializers)) 349#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 350#endif 351 352#if __has_feature(is_base_of) 353# define _LIBCPP_HAS_IS_BASE_OF 354#endif 355 356#if __has_feature(is_final) 357# define _LIBCPP_HAS_IS_FINAL 358#endif 359 360// Objective-C++ features (opt-in) 361#if __has_feature(objc_arc) 362#define _LIBCPP_HAS_OBJC_ARC 363#endif 364 365#if __has_feature(objc_arc_weak) 366#define _LIBCPP_HAS_OBJC_ARC_WEAK 367#define _LIBCPP_HAS_NO_STRONG_ENUMS 368#endif 369 370#if !(__has_feature(cxx_constexpr)) 371#define _LIBCPP_HAS_NO_CONSTEXPR 372#endif 373 374#if !(__has_feature(cxx_relaxed_constexpr)) 375#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR 376#endif 377 378#if !(__has_feature(cxx_variable_templates)) 379#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES 380#endif 381 382#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L 383#if defined(__FreeBSD__) 384#define _LIBCPP_HAS_QUICK_EXIT 385#define _LIBCPP_HAS_C11_FEATURES 386#elif defined(__ANDROID__) 387#define _LIBCPP_HAS_QUICK_EXIT 388#elif defined(__linux__) 389#if !defined(_LIBCPP_HAS_MUSL_LIBC) 390# include <features.h> 391#if __GLIBC_PREREQ(2, 15) 392#define _LIBCPP_HAS_QUICK_EXIT 393#endif 394#if __GLIBC_PREREQ(2, 17) 395#define _LIBCPP_HAS_C11_FEATURES 396#endif 397#else // defined(_LIBCPP_HAS_MUSL_LIBC) 398#define _LIBCPP_HAS_QUICK_EXIT 399#define _LIBCPP_HAS_C11_FEATURES 400#endif 401#endif // __linux__ 402#endif 403 404#if (__has_feature(cxx_noexcept)) 405# define _NOEXCEPT noexcept 406# define _NOEXCEPT_(x) noexcept(x) 407# define _NOEXCEPT_OR_FALSE(x) noexcept(x) 408#else 409# define _NOEXCEPT throw() 410# define _NOEXCEPT_(x) 411# define _NOEXCEPT_OR_FALSE(x) false 412#endif 413 414#if __has_feature(underlying_type) 415# define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) 416#endif 417 418#if __has_feature(is_literal) 419# define _LIBCPP_IS_LITERAL(T) __is_literal(T) 420#endif 421 422// Inline namespaces are available in Clang regardless of C++ dialect. 423#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE { 424#define _LIBCPP_END_NAMESPACE_STD } } 425#define _VSTD std::_LIBCPP_NAMESPACE 426 427namespace std { 428 inline namespace _LIBCPP_NAMESPACE { 429 } 430} 431 432#if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer) 433#define _LIBCPP_HAS_NO_ASAN 434#endif 435 436#elif defined(__GNUC__) 437 438#define _ALIGNAS(x) __attribute__((__aligned__(x))) 439#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) 440 441#define _LIBCPP_NORETURN __attribute__((noreturn)) 442 443#define _LIBCPP_UNUSED __attribute__((__unused__)) 444 445#if _GNUC_VER >= 407 446#define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) 447#define _LIBCPP_IS_LITERAL(T) __is_literal_type(T) 448#define _LIBCPP_HAS_IS_FINAL 449#endif 450 451#if defined(__GNUC__) && _GNUC_VER >= 403 452# define _LIBCPP_HAS_IS_BASE_OF 453#endif 454 455#if !__EXCEPTIONS 456#define _LIBCPP_NO_EXCEPTIONS 457#endif 458 459#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES 460 461// constexpr was added to GCC in 4.6. 462#if _GNUC_VER < 406 463#define _LIBCPP_HAS_NO_CONSTEXPR 464// Can only use constexpr in c++11 mode. 465#elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L 466#define _LIBCPP_HAS_NO_CONSTEXPR 467#endif 468 469// Determine if GCC supports relaxed constexpr 470#if !defined(__cpp_constexpr) || __cpp_constexpr < 201304L 471#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR 472#endif 473 474// GCC 5 will support variable templates 475#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES 476 477#define _NOEXCEPT throw() 478#define _NOEXCEPT_(x) 479#define _NOEXCEPT_OR_FALSE(x) false 480 481#ifndef __GXX_EXPERIMENTAL_CXX0X__ 482 483#define _LIBCPP_HAS_NO_ADVANCED_SFINAE 484#define _LIBCPP_HAS_NO_DECLTYPE 485#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS 486#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS 487#define _LIBCPP_HAS_NO_NULLPTR 488#define _LIBCPP_HAS_NO_STATIC_ASSERT 489#define _LIBCPP_HAS_NO_UNICODE_CHARS 490#define _LIBCPP_HAS_NO_VARIADICS 491#define _LIBCPP_HAS_NO_RVALUE_REFERENCES 492#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS 493#define _LIBCPP_HAS_NO_STRONG_ENUMS 494 495#else // __GXX_EXPERIMENTAL_CXX0X__ 496 497#define _LIBCPP_HAS_NO_TRAILING_RETURN 498#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS 499 500#if _GNUC_VER < 403 501#define _LIBCPP_HAS_NO_RVALUE_REFERENCES 502#endif 503 504#if _GNUC_VER < 403 505#define _LIBCPP_HAS_NO_STATIC_ASSERT 506#endif 507 508#if _GNUC_VER < 404 509#define _LIBCPP_HAS_NO_DECLTYPE 510#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS 511#define _LIBCPP_HAS_NO_UNICODE_CHARS 512#define _LIBCPP_HAS_NO_VARIADICS 513#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 514#endif // _GNUC_VER < 404 515 516#if _GNUC_VER < 406 517#define _LIBCPP_HAS_NO_NULLPTR 518#endif 519 520#if _GNUC_VER < 407 521#define _LIBCPP_HAS_NO_ADVANCED_SFINAE 522#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS 523#endif 524 525#endif // __GXX_EXPERIMENTAL_CXX0X__ 526 527#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE { 528#define _LIBCPP_END_NAMESPACE_STD } } 529#define _VSTD std::_LIBCPP_NAMESPACE 530 531namespace std { 532namespace _LIBCPP_NAMESPACE { 533} 534using namespace _LIBCPP_NAMESPACE __attribute__((__strong__)); 535} 536 537#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__) 538#define _LIBCPP_HAS_NO_ASAN 539#endif 540 541#elif defined(_LIBCPP_MSVC) 542 543#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES 544#define _LIBCPP_HAS_NO_CONSTEXPR 545#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR 546#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES 547#define _LIBCPP_HAS_NO_UNICODE_CHARS 548#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS 549#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS 550#define __alignof__ __alignof 551#define _LIBCPP_NORETURN __declspec(noreturn) 552#define _LIBCPP_UNUSED 553#define _ALIGNAS(x) __declspec(align(x)) 554#define _LIBCPP_HAS_NO_VARIADICS 555 556#define _NOEXCEPT throw () 557#define _NOEXCEPT_(x) 558#define _NOEXCEPT_OR_FALSE(x) false 559 560#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { 561#define _LIBCPP_END_NAMESPACE_STD } 562#define _VSTD std 563 564# define _LIBCPP_WEAK 565namespace std { 566} 567 568#define _LIBCPP_HAS_NO_ASAN 569 570#elif defined(__IBMCPP__) 571 572#define _ALIGNAS(x) __attribute__((__aligned__(x))) 573#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) 574#define _ATTRIBUTE(x) __attribute__((x)) 575#define _LIBCPP_NORETURN __attribute__((noreturn)) 576#define _LIBCPP_UNUSED 577 578#define _NOEXCEPT throw() 579#define _NOEXCEPT_(x) 580#define _NOEXCEPT_OR_FALSE(x) false 581 582#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES 583#define _LIBCPP_HAS_NO_ADVANCED_SFINAE 584#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS 585#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 586#define _LIBCPP_HAS_NO_NULLPTR 587#define _LIBCPP_HAS_NO_UNICODE_CHARS 588#define _LIBCPP_HAS_IS_BASE_OF 589#define _LIBCPP_HAS_IS_FINAL 590#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES 591 592#if defined(_AIX) 593#define __MULTILOCALE_API 594#endif 595 596#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE { 597#define _LIBCPP_END_NAMESPACE_STD } } 598#define _VSTD std::_LIBCPP_NAMESPACE 599 600namespace std { 601 inline namespace _LIBCPP_NAMESPACE { 602 } 603} 604 605#define _LIBCPP_HAS_NO_ASAN 606 607#endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__ 608 609#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS 610typedef unsigned short char16_t; 611typedef unsigned int char32_t; 612#endif // _LIBCPP_HAS_NO_UNICODE_CHARS 613 614#ifndef __SIZEOF_INT128__ 615#define _LIBCPP_HAS_NO_INT128 616#endif 617 618#ifdef _LIBCPP_HAS_NO_STATIC_ASSERT 619 620extern "C++" { 621template <bool> struct __static_assert_test; 622template <> struct __static_assert_test<true> {}; 623template <unsigned> struct __static_assert_check {}; 624} 625#define static_assert(__b, __m) \ 626 typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \ 627 _LIBCPP_CONCAT(__t, __LINE__) 628 629#endif // _LIBCPP_HAS_NO_STATIC_ASSERT 630 631#ifdef _LIBCPP_HAS_NO_DECLTYPE 632// GCC 4.6 provides __decltype in all standard modes. 633#if !__is_identifier(__decltype) || _GNUC_VER >= 406 634# define decltype(__x) __decltype(__x) 635#else 636# define decltype(__x) __typeof__(__x) 637#endif 638#endif 639 640#ifdef _LIBCPP_HAS_NO_CONSTEXPR 641#define _LIBCPP_CONSTEXPR 642#else 643#define _LIBCPP_CONSTEXPR constexpr 644#endif 645 646#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS 647#define _LIBCPP_DEFAULT {} 648#else 649#define _LIBCPP_DEFAULT = default; 650#endif 651 652#ifdef __GNUC__ 653#define _NOALIAS __attribute__((__malloc__)) 654#else 655#define _NOALIAS 656#endif 657 658#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) 659# define _LIBCPP_EXPLICIT explicit 660#else 661# define _LIBCPP_EXPLICIT 662#endif 663 664#if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete) 665# define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE 666#endif 667 668#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS 669#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx 670#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ 671 __lx __v_; \ 672 _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \ 673 _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \ 674 _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ 675 }; 676#else // _LIBCPP_HAS_NO_STRONG_ENUMS 677#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x 678#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) 679#endif // _LIBCPP_HAS_NO_STRONG_ENUMS 680 681#ifdef _LIBCPP_DEBUG 682# if _LIBCPP_DEBUG == 0 683# define _LIBCPP_DEBUG_LEVEL 1 684# elif _LIBCPP_DEBUG == 1 685# define _LIBCPP_DEBUG_LEVEL 2 686# else 687# error Supported values for _LIBCPP_DEBUG are 0 and 1 688# endif 689# define _LIBCPP_EXTERN_TEMPLATE(...) 690#endif 691 692#ifndef _LIBCPP_EXTERN_TEMPLATE 693#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; 694#endif 695 696#ifndef _LIBCPP_EXTERN_TEMPLATE2 697#define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__; 698#endif 699 700#if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__) 701#define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63) 702#endif 703 704#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || \ 705 defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__) 706#define _LIBCPP_LOCALE__L_EXTENSIONS 1 707#endif 708 709#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) && \ 710 !defined(__CloudABI__) 711#define _LIBCPP_HAS_CATOPEN 1 712#endif 713 714#ifdef __FreeBSD__ 715#define _DECLARE_C99_LDBL_MATH 1 716#endif 717 718#if defined(__APPLE__) || defined(__FreeBSD__) 719#define _LIBCPP_HAS_DEFAULTRUNELOCALE 720#endif 721 722#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__) 723#define _LIBCPP_WCTYPE_IS_MASK 724#endif 725 726#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 727# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1 728#endif 729 730#ifndef _LIBCPP_STD_VER 731# if __cplusplus <= 201103L 732# define _LIBCPP_STD_VER 11 733# elif __cplusplus <= 201402L 734# define _LIBCPP_STD_VER 14 735# else 736# define _LIBCPP_STD_VER 15 // current year, or date of c++17 ratification 737# endif 738#endif // _LIBCPP_STD_VER 739 740#if _LIBCPP_STD_VER > 11 741#define _LIBCPP_DEPRECATED [[deprecated]] 742#else 743#define _LIBCPP_DEPRECATED 744#endif 745 746#if _LIBCPP_STD_VER <= 11 747#define _LIBCPP_EXPLICIT_AFTER_CXX11 748#define _LIBCPP_DEPRECATED_AFTER_CXX11 749#else 750#define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit 751#define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]] 752#endif 753 754#if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) 755#define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr 756#else 757#define _LIBCPP_CONSTEXPR_AFTER_CXX11 758#endif 759 760#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES 761# define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x) 762#else 763# define _LIBCPP_EXPLICIT_MOVE(x) (x) 764#endif 765 766#ifndef _LIBCPP_HAS_NO_ASAN 767extern "C" void __sanitizer_annotate_contiguous_container( 768 const void *, const void *, const void *, const void *); 769#endif 770 771// Try to find out if RTTI is disabled. 772// g++ and cl.exe have RTTI on by default and define a macro when it is. 773// g++ only defines the macro in 4.3.2 and onwards. 774#if !defined(_LIBCPP_NO_RTTI) 775# if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \ 776 (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI) 777# define _LIBCPP_NO_RTTI 778# elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI) 779# define _LIBCPP_NO_RTTI 780# endif 781#endif 782 783#ifndef _LIBCPP_WEAK 784# define _LIBCPP_WEAK __attribute__((__weak__)) 785#endif 786 787#if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS) 788# error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \ 789 _LIBCPP_HAS_NO_THREADS is defined. 790#endif 791 792// Systems that use capability-based security (FreeBSD with Capsicum, 793// Nuxi CloudABI) may only provide local filesystem access (using *at()). 794// Functions like open(), rename(), unlink() and stat() should not be 795// used, as they attempt to access the global filesystem namespace. 796#ifdef __CloudABI__ 797#define _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE 798#endif 799 800// CloudABI is intended for running networked services. Processes do not 801// have standard input and output channels. 802#ifdef __CloudABI__ 803#define _LIBCPP_HAS_NO_STDIN 804#define _LIBCPP_HAS_NO_STDOUT 805#endif 806 807#if defined(__ANDROID__) || defined(__CloudABI__) || defined(_LIBCPP_HAS_MUSL_LIBC) 808#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE 809#endif 810 811// Thread-unsafe functions such as strtok(), mbtowc() and localtime() 812// are not available. 813#ifdef __CloudABI__ 814#define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS 815#endif 816 817#if __has_feature(cxx_atomic) || __has_extension(c_atomic) 818#define _LIBCPP_HAS_C_ATOMIC_IMP 819#elif _GNUC_VER > 407 820#define _LIBCPP_HAS_GCC_ATOMIC_IMP 821#endif 822 823#if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \ 824 || defined(_LIBCPP_HAS_NO_THREADS) 825#define _LIBCPP_HAS_NO_ATOMIC_HEADER 826#endif 827 828#endif // __cplusplus 829 830#endif // _LIBCPP_CONFIG 831