libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

__config (47833B)


      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 // CONFIG_PLACEHOLDER
     15 #ifndef _LIBCPP_NO_CONFIG
     16 #  error Wrong header included
     17 #endif
     18 // CONFIG_PLACEHOLDER_END
     19 
     20 #ifdef __vita__
     21 #define _LIBCPP_HAS_THREAD_API_PTHREAD
     22 #define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
     23 #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
     24 #endif
     25 
     26 #if defined(_MSC_VER) && !defined(__clang__)
     27 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
     28 #    define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
     29 #  endif
     30 #endif
     31 
     32 #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
     33 #pragma GCC system_header
     34 #endif
     35 
     36 #ifdef __cplusplus
     37 
     38 #ifdef __GNUC__
     39 #  define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
     40 // The _GNUC_VER_NEW macro better represents the new GCC versioning scheme
     41 // introduced in GCC 5.0.
     42 #  define _GNUC_VER_NEW (_GNUC_VER * 10 + __GNUC_PATCHLEVEL__)
     43 #else
     44 #  define _GNUC_VER 0
     45 #  define _GNUC_VER_NEW 0
     46 #endif
     47 
     48 #define _LIBCPP_VERSION 8000
     49 
     50 #ifndef _LIBCPP_ABI_VERSION
     51 #  define _LIBCPP_ABI_VERSION 1
     52 #endif
     53 
     54 #ifndef _LIBCPP_STD_VER
     55 #  if  __cplusplus <= 201103L
     56 #    define _LIBCPP_STD_VER 11
     57 #  elif __cplusplus <= 201402L
     58 #    define _LIBCPP_STD_VER 14
     59 #  elif __cplusplus <= 201703L
     60 #    define _LIBCPP_STD_VER 17
     61 #  else
     62 #    define _LIBCPP_STD_VER 18  // current year, or date of c++2a ratification
     63 #  endif
     64 #endif  // _LIBCPP_STD_VER
     65 
     66 #if defined(__ELF__)
     67 #  define _LIBCPP_OBJECT_FORMAT_ELF   1
     68 #elif defined(__MACH__)
     69 #  define _LIBCPP_OBJECT_FORMAT_MACHO 1
     70 #elif defined(_WIN32)
     71 #  define _LIBCPP_OBJECT_FORMAT_COFF  1
     72 #elif defined(__wasm__)
     73 #  define _LIBCPP_OBJECT_FORMAT_WASM  1
     74 #else
     75 #  error Unknown object file format
     76 #endif
     77 
     78 #if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
     79 // Change short string representation so that string data starts at offset 0,
     80 // improving its alignment in some cases.
     81 #  define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
     82 // Fix deque iterator type in order to support incomplete types.
     83 #  define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
     84 // Fix undefined behavior in how std::list stores its linked nodes.
     85 #  define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
     86 // Fix undefined behavior in  how __tree stores its end and parent nodes.
     87 #  define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB
     88 // Fix undefined behavior in how __hash_table stores its pointer types.
     89 #  define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
     90 #  define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
     91 #  define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
     92 // Don't use a nullptr_t simulation type in C++03 instead using C++11 nullptr
     93 // provided under the alternate keyword __nullptr, which changes the mangling
     94 // of nullptr_t. This option is ABI incompatible with GCC in C++03 mode.
     95 #  define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR
     96 // Define the `pointer_safety` enum as a C++11 strongly typed enumeration
     97 // instead of as a class simulating an enum. If this option is enabled
     98 // `pointer_safety` and `get_pointer_safety()` will no longer be available
     99 // in C++03.
    100 #  define _LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE
    101 // Define a key function for `bad_function_call` in the library, to centralize
    102 // its vtable and typeinfo to libc++ rather than having all other libraries
    103 // using that class define their own copies.
    104 #  define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
    105 // Enable optimized version of __do_get_(un)signed which avoids redundant copies.
    106 #  define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
    107 // Use the smallest possible integer type to represent the index of the variant.
    108 // Previously libc++ used "unsigned int" exclusivly.
    109 #  define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
    110 // Unstable attempt to provide a more optimized std::function
    111 #  define _LIBCPP_ABI_OPTIMIZED_FUNCTION
    112 #elif _LIBCPP_ABI_VERSION == 1
    113 #  if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
    114 // Enable compiling copies of now inline methods into the dylib to support
    115 // applications compiled against older libraries. This is unnecessary with
    116 // COFF dllexport semantics, since dllexport forces a non-inline definition
    117 // of inline functions to be emitted anyway. Our own non-inline copy would
    118 // conflict with the dllexport-emitted copy, so we disable it.
    119 #    define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
    120 #  endif
    121 // Feature macros for disabling pre ABI v1 features. All of these options
    122 // are deprecated.
    123 #  if defined(__FreeBSD__)
    124 #    define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
    125 #  endif
    126 #endif
    127 
    128 #ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
    129 #error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \
    130        use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead
    131 #endif
    132 
    133 #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
    134 #define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y)
    135 
    136 #ifndef _LIBCPP_ABI_NAMESPACE
    137 # define _LIBCPP_ABI_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)
    138 #endif
    139 
    140 #if __cplusplus < 201103L
    141 #define _LIBCPP_CXX03_LANG
    142 #endif
    143 
    144 #ifndef __has_attribute
    145 #define __has_attribute(__x) 0
    146 #endif
    147 
    148 #ifndef __has_builtin
    149 #define __has_builtin(__x) 0
    150 #endif
    151 
    152 #ifndef __has_extension
    153 #define __has_extension(__x) 0
    154 #endif
    155 
    156 #ifndef __has_feature
    157 #define __has_feature(__x) 0
    158 #endif
    159 
    160 #ifndef __has_cpp_attribute
    161 #define __has_cpp_attribute(__x) 0
    162 #endif
    163 
    164 // '__is_identifier' returns '0' if '__x' is a reserved identifier provided by
    165 // the compiler and '1' otherwise.
    166 #ifndef __is_identifier
    167 #define __is_identifier(__x) 1
    168 #endif
    169 
    170 #ifndef __has_declspec_attribute
    171 #define __has_declspec_attribute(__x) 0
    172 #endif
    173 
    174 #define __has_keyword(__x) !(__is_identifier(__x))
    175 
    176 #ifndef __has_include
    177 #define __has_include(...) 0
    178 #endif
    179 
    180 #if defined(__clang__)
    181 #  define _LIBCPP_COMPILER_CLANG
    182 #  ifndef __apple_build_version__
    183 #    define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
    184 #  endif
    185 #elif defined(__GNUC__)
    186 #  define _LIBCPP_COMPILER_GCC
    187 #elif defined(_MSC_VER)
    188 #  define _LIBCPP_COMPILER_MSVC
    189 #elif defined(__IBMCPP__)
    190 #  define _LIBCPP_COMPILER_IBM
    191 #endif
    192 
    193 #ifndef _LIBCPP_CLANG_VER
    194 #define _LIBCPP_CLANG_VER 0
    195 #endif
    196 
    197 // FIXME: ABI detection should be done via compiler builtin macros. This
    198 // is just a placeholder until Clang implements such macros. For now assume
    199 // that Windows compilers pretending to be MSVC++ target the Microsoft ABI,
    200 // and allow the user to explicitly specify the ABI to handle cases where this
    201 // heuristic falls short.
    202 #if defined(_LIBCPP_ABI_FORCE_ITANIUM) && defined(_LIBCPP_ABI_FORCE_MICROSOFT)
    203 #  error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined"
    204 #elif defined(_LIBCPP_ABI_FORCE_ITANIUM)
    205 #  define _LIBCPP_ABI_ITANIUM
    206 #elif defined(_LIBCPP_ABI_FORCE_MICROSOFT)
    207 #  define _LIBCPP_ABI_MICROSOFT
    208 #else
    209 #  if defined(_WIN32) && defined(_MSC_VER)
    210 #    define _LIBCPP_ABI_MICROSOFT
    211 #  else
    212 #    define _LIBCPP_ABI_ITANIUM
    213 #  endif
    214 #endif
    215 
    216 // Need to detect which libc we're using if we're on Linux.
    217 #if defined(__linux__)
    218 #  include <features.h>
    219 #  if defined(__GLIBC_PREREQ)
    220 #    define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
    221 #  else
    222 #    define _LIBCPP_GLIBC_PREREQ(a, b) 0
    223 #  endif // defined(__GLIBC_PREREQ)
    224 #endif // defined(__linux__)
    225 
    226 #ifdef __LITTLE_ENDIAN__
    227 #  if __LITTLE_ENDIAN__
    228 #    define _LIBCPP_LITTLE_ENDIAN
    229 #  endif  // __LITTLE_ENDIAN__
    230 #endif  // __LITTLE_ENDIAN__
    231 
    232 #ifdef __BIG_ENDIAN__
    233 #  if __BIG_ENDIAN__
    234 #    define _LIBCPP_BIG_ENDIAN
    235 #  endif  // __BIG_ENDIAN__
    236 #endif  // __BIG_ENDIAN__
    237 
    238 #ifdef __BYTE_ORDER__
    239 #  if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
    240 #    define _LIBCPP_LITTLE_ENDIAN
    241 #  elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
    242 #    define _LIBCPP_BIG_ENDIAN
    243 #  endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
    244 #endif // __BYTE_ORDER__
    245 
    246 #ifdef __FreeBSD__
    247 #  include <sys/endian.h>
    248 #  if _BYTE_ORDER == _LITTLE_ENDIAN
    249 #    define _LIBCPP_LITTLE_ENDIAN
    250 #  else  // _BYTE_ORDER == _LITTLE_ENDIAN
    251 #    define _LIBCPP_BIG_ENDIAN
    252 #  endif  // _BYTE_ORDER == _LITTLE_ENDIAN
    253 #  ifndef __LONG_LONG_SUPPORTED
    254 #    define _LIBCPP_HAS_NO_LONG_LONG
    255 #  endif  // __LONG_LONG_SUPPORTED
    256 #endif  // __FreeBSD__
    257 
    258 #ifdef __NetBSD__
    259 #  include <sys/endian.h>
    260 #  if _BYTE_ORDER == _LITTLE_ENDIAN
    261 #    define _LIBCPP_LITTLE_ENDIAN
    262 #  else  // _BYTE_ORDER == _LITTLE_ENDIAN
    263 #    define _LIBCPP_BIG_ENDIAN
    264 #  endif  // _BYTE_ORDER == _LITTLE_ENDIAN
    265 #  define _LIBCPP_HAS_QUICK_EXIT
    266 #endif  // __NetBSD__
    267 
    268 #if defined(_WIN32)
    269 #  define _LIBCPP_WIN32API
    270 #  define _LIBCPP_LITTLE_ENDIAN
    271 #  define _LIBCPP_SHORT_WCHAR   1
    272 // Both MinGW and native MSVC provide a "MSVC"-like enviroment
    273 #  define _LIBCPP_MSVCRT_LIKE
    274 // If mingw not explicitly detected, assume using MS C runtime only if
    275 // a MS compatibility version is specified.
    276 #  if defined(_MSC_VER) && !defined(__MINGW32__)
    277 #    define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
    278 #  endif
    279 #  if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__))
    280 #    define _LIBCPP_HAS_BITSCAN64
    281 #  endif
    282 #  define _LIBCPP_HAS_OPEN_WITH_WCHAR
    283 #  if defined(_LIBCPP_MSVCRT)
    284 #    define _LIBCPP_HAS_QUICK_EXIT
    285 #  endif
    286 
    287 // Some CRT APIs are unavailable to store apps
    288 #  if defined(WINAPI_FAMILY)
    289 #    include <winapifamily.h>
    290 #    if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) &&                  \
    291         (!defined(WINAPI_PARTITION_SYSTEM) ||                                  \
    292          !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM))
    293 #      define _LIBCPP_WINDOWS_STORE_APP
    294 #    endif
    295 #  endif
    296 #endif // defined(_WIN32)
    297 
    298 #ifdef __sun__
    299 #  include <sys/isa_defs.h>
    300 #  ifdef _LITTLE_ENDIAN
    301 #    define _LIBCPP_LITTLE_ENDIAN
    302 #  else
    303 #    define _LIBCPP_BIG_ENDIAN
    304 #  endif
    305 #endif // __sun__
    306 
    307 #if defined(__CloudABI__)
    308    // Certain architectures provide arc4random(). Prefer using
    309    // arc4random() over /dev/{u,}random to make it possible to obtain
    310    // random data even when using sandboxing mechanisms such as chroots,
    311    // Capsicum, etc.
    312 #  define _LIBCPP_USING_ARC4_RANDOM
    313 #elif defined(__Fuchsia__)
    314 #  define _LIBCPP_USING_GETENTROPY
    315 #elif defined(__native_client__)
    316    // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
    317    // including accesses to the special files under /dev. C++11's
    318    // std::random_device is instead exposed through a NaCl syscall.
    319 #  define _LIBCPP_USING_NACL_RANDOM
    320 #elif defined(_LIBCPP_WIN32API)
    321 #  define _LIBCPP_USING_WIN32_RANDOM
    322 #else
    323 #  define _LIBCPP_USING_DEV_RANDOM
    324 #endif
    325 
    326 #if !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN)
    327 #  include <endian.h>
    328 #  if __BYTE_ORDER == __LITTLE_ENDIAN
    329 #    define _LIBCPP_LITTLE_ENDIAN
    330 #  elif __BYTE_ORDER == __BIG_ENDIAN
    331 #    define _LIBCPP_BIG_ENDIAN
    332 #  else  // __BYTE_ORDER == __BIG_ENDIAN
    333 #    error unable to determine endian
    334 #  endif
    335 #endif  // !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN)
    336 
    337 #if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC)
    338 #  define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
    339 #else
    340 #  define _LIBCPP_NO_CFI
    341 #endif
    342 
    343 #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
    344 #  if defined(__FreeBSD__)
    345 #    define _LIBCPP_HAS_QUICK_EXIT
    346 #    define _LIBCPP_HAS_C11_FEATURES
    347 #  elif defined(__Fuchsia__)
    348 #    define _LIBCPP_HAS_QUICK_EXIT
    349 #    define _LIBCPP_HAS_TIMESPEC_GET
    350 #    define _LIBCPP_HAS_C11_FEATURES
    351 #  elif defined(__linux__)
    352 #    if !defined(_LIBCPP_HAS_MUSL_LIBC)
    353 #      if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
    354 #        define _LIBCPP_HAS_QUICK_EXIT
    355 #      endif
    356 #      if _LIBCPP_GLIBC_PREREQ(2, 17)
    357 #        define _LIBCPP_HAS_C11_FEATURES
    358 #        define _LIBCPP_HAS_TIMESPEC_GET
    359 #      endif
    360 #    else // defined(_LIBCPP_HAS_MUSL_LIBC)
    361 #      define _LIBCPP_HAS_QUICK_EXIT
    362 #      define _LIBCPP_HAS_TIMESPEC_GET
    363 #      define _LIBCPP_HAS_C11_FEATURES
    364 #    endif
    365 #  endif // __linux__
    366 #endif
    367 
    368 #ifndef _LIBCPP_CXX03_LANG
    369 # define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp)
    370 #elif defined(_LIBCPP_COMPILER_CLANG)
    371 # define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp)
    372 #else
    373 // This definition is potentially buggy, but it's only taken with GCC in C++03,
    374 // which we barely support anyway. See llvm.org/PR39713
    375 # define _LIBCPP_ALIGNOF(_Tp) __alignof(_Tp)
    376 #endif
    377 
    378 #define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
    379 
    380 #if defined(_LIBCPP_COMPILER_CLANG)
    381 
    382 // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for
    383 // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility.
    384 #if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) &&       \
    385      (!defined(__arm__) || __ARM_ARCH_7K__ >= 2)) ||                           \
    386     defined(_LIBCPP_ALTERNATE_STRING_LAYOUT)
    387 #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
    388 #endif
    389 
    390 #if __has_feature(cxx_alignas)
    391 #  define _ALIGNAS_TYPE(x) alignas(x)
    392 #  define _ALIGNAS(x) alignas(x)
    393 #else
    394 #  define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCPP_ALIGNOF(x))))
    395 #  define _ALIGNAS(x) __attribute__((__aligned__(x)))
    396 #endif
    397 
    398 #if __cplusplus < 201103L
    399 typedef __char16_t char16_t;
    400 typedef __char32_t char32_t;
    401 #endif
    402 
    403 #if !(__has_feature(cxx_exceptions)) && !defined(_LIBCPP_NO_EXCEPTIONS)
    404 #define _LIBCPP_NO_EXCEPTIONS
    405 #endif
    406 
    407 #if !(__has_feature(cxx_rtti)) && !defined(_LIBCPP_NO_RTTI)
    408 #define _LIBCPP_NO_RTTI
    409 #endif
    410 
    411 #if !(__has_feature(cxx_strong_enums))
    412 #define _LIBCPP_HAS_NO_STRONG_ENUMS
    413 #endif
    414 
    415 #if !(__has_feature(cxx_decltype))
    416 #define _LIBCPP_HAS_NO_DECLTYPE
    417 #endif
    418 
    419 #if __has_feature(cxx_attributes)
    420 #  define _LIBCPP_NORETURN [[noreturn]]
    421 #else
    422 #  define _LIBCPP_NORETURN __attribute__ ((noreturn))
    423 #endif
    424 
    425 #if !(__has_feature(cxx_lambdas))
    426 #define _LIBCPP_HAS_NO_LAMBDAS
    427 #endif
    428 
    429 #if !(__has_feature(cxx_nullptr))
    430 #  if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR)
    431 #    define nullptr __nullptr
    432 #  else
    433 #    define _LIBCPP_HAS_NO_NULLPTR
    434 #  endif
    435 #endif
    436 
    437 #if !(__has_feature(cxx_rvalue_references))
    438 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
    439 #endif
    440 
    441 #if !(__has_feature(cxx_auto_type))
    442 #define _LIBCPP_HAS_NO_AUTO_TYPE
    443 #endif
    444 
    445 #if !(__has_feature(cxx_variadic_templates))
    446 #define _LIBCPP_HAS_NO_VARIADICS
    447 #endif
    448 
    449 #if !(__has_feature(cxx_generalized_initializers))
    450 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    451 #endif
    452 
    453 #if __has_feature(is_base_of)
    454 #define _LIBCPP_HAS_IS_BASE_OF
    455 #endif
    456 
    457 #if __has_feature(is_final)
    458 #define _LIBCPP_HAS_IS_FINAL
    459 #endif
    460 
    461 // Objective-C++ features (opt-in)
    462 #if __has_feature(objc_arc)
    463 #define _LIBCPP_HAS_OBJC_ARC
    464 #endif
    465 
    466 #if __has_feature(objc_arc_weak)
    467 #define _LIBCPP_HAS_OBJC_ARC_WEAK
    468 #endif
    469 
    470 #if !(__has_feature(cxx_constexpr))
    471 #define _LIBCPP_HAS_NO_CONSTEXPR
    472 #endif
    473 
    474 #if !(__has_feature(cxx_relaxed_constexpr))
    475 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
    476 #endif
    477 
    478 #if !(__has_feature(cxx_variable_templates))
    479 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
    480 #endif
    481 
    482 #if !(__has_feature(cxx_noexcept))
    483 #define _LIBCPP_HAS_NO_NOEXCEPT
    484 #endif
    485 
    486 #if __has_feature(underlying_type)
    487 #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
    488 #endif
    489 
    490 #if __has_feature(is_literal)
    491 #define _LIBCPP_IS_LITERAL(T) __is_literal(T)
    492 #endif
    493 
    494 #if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer)
    495 #define _LIBCPP_HAS_NO_ASAN
    496 #endif
    497 
    498 // Allow for build-time disabling of unsigned integer sanitization
    499 #if !defined(_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK) && __has_attribute(no_sanitize)
    500 #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow")))
    501 #endif
    502 
    503 #if __has_builtin(__builtin_launder)
    504 #define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
    505 #endif
    506 
    507 #if !__is_identifier(__has_unique_object_representations)
    508 #define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
    509 #endif
    510 
    511 #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
    512 
    513 // No apple compilers support ""d and ""y at this time.
    514 #if _LIBCPP_CLANG_VER < 800 || defined(__apple_build_version__)
    515 #define	_LIBCPP_HAS_NO_CXX20_CHRONO_LITERALS
    516 #endif
    517 
    518 #elif defined(_LIBCPP_COMPILER_GCC)
    519 
    520 #define _ALIGNAS(x) __attribute__((__aligned__(x)))
    521 #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCPP_ALIGNOF(x))))
    522 
    523 #define _LIBCPP_NORETURN __attribute__((noreturn))
    524 
    525 #if _GNUC_VER >= 407
    526 #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
    527 #define _LIBCPP_IS_LITERAL(T) __is_literal_type(T)
    528 #define _LIBCPP_HAS_IS_FINAL
    529 #endif
    530 
    531 #if defined(__GNUC__) && _GNUC_VER >= 403
    532 #define _LIBCPP_HAS_IS_BASE_OF
    533 #endif
    534 
    535 #if !__EXCEPTIONS && !defined(_LIBCPP_NO_EXCEPTIONS)
    536 #define _LIBCPP_NO_EXCEPTIONS
    537 #endif
    538 
    539 // constexpr was added to GCC in 4.6.
    540 #if _GNUC_VER < 406
    541 #  define _LIBCPP_HAS_NO_CONSTEXPR
    542 // Can only use constexpr in c++11 mode.
    543 #elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
    544 #  define _LIBCPP_HAS_NO_CONSTEXPR
    545 #endif
    546 
    547 // Determine if GCC supports relaxed constexpr
    548 #if !defined(__cpp_constexpr) || __cpp_constexpr < 201304L
    549 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
    550 #endif
    551 
    552 // GCC 5 will support variable templates
    553 #if !defined(__cpp_variable_templates) || __cpp_variable_templates < 201304L
    554 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
    555 #endif
    556 
    557 #ifndef __GXX_EXPERIMENTAL_CXX0X__
    558 
    559 #define _LIBCPP_HAS_NO_DECLTYPE
    560 #define _LIBCPP_HAS_NO_NULLPTR
    561 #define _LIBCPP_HAS_NO_UNICODE_CHARS
    562 #define _LIBCPP_HAS_NO_VARIADICS
    563 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
    564 #define _LIBCPP_HAS_NO_STRONG_ENUMS
    565 #define _LIBCPP_HAS_NO_NOEXCEPT
    566 
    567 #else  // __GXX_EXPERIMENTAL_CXX0X__
    568 
    569 #if _GNUC_VER < 403
    570 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
    571 #endif
    572 
    573 
    574 #if _GNUC_VER < 404
    575 #define _LIBCPP_HAS_NO_DECLTYPE
    576 #define _LIBCPP_HAS_NO_UNICODE_CHARS
    577 #define _LIBCPP_HAS_NO_VARIADICS
    578 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    579 #endif  // _GNUC_VER < 404
    580 
    581 #if _GNUC_VER < 406
    582 #define _LIBCPP_HAS_NO_NOEXCEPT
    583 #define _LIBCPP_HAS_NO_NULLPTR
    584 #endif
    585 
    586 #endif  // __GXX_EXPERIMENTAL_CXX0X__
    587 
    588 #if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__)
    589 #define _LIBCPP_HAS_NO_ASAN
    590 #endif
    591 
    592 #if _GNUC_VER >= 700
    593 #define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
    594 #endif
    595 
    596 #if _GNUC_VER >= 700
    597 #define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
    598 #endif
    599 
    600 #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
    601 
    602 #elif defined(_LIBCPP_COMPILER_MSVC)
    603 
    604 #define _LIBCPP_TOSTRING2(x) #x
    605 #define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
    606 #define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x))
    607 
    608 #if _MSC_VER < 1900
    609 #error "MSVC versions prior to Visual Studio 2015 are not supported"
    610 #endif
    611 
    612 #define _LIBCPP_HAS_IS_BASE_OF
    613 #define _LIBCPP_HAS_NO_CONSTEXPR
    614 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
    615 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
    616 #define _LIBCPP_HAS_NO_NOEXCEPT
    617 #define __alignof__ __alignof
    618 #define _LIBCPP_NORETURN __declspec(noreturn)
    619 #define _ALIGNAS(x) __declspec(align(x))
    620 #define _ALIGNAS_TYPE(x) alignas(x)
    621 #define _LIBCPP_HAS_NO_VARIADICS
    622 
    623 #define _LIBCPP_WEAK
    624 
    625 #define _LIBCPP_HAS_NO_ASAN
    626 
    627 #define _LIBCPP_ALWAYS_INLINE __forceinline
    628 
    629 #define _LIBCPP_HAS_NO_VECTOR_EXTENSION
    630 
    631 #elif defined(_LIBCPP_COMPILER_IBM)
    632 
    633 #define _ALIGNAS(x) __attribute__((__aligned__(x)))
    634 #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCPP_ALIGNOF(x))))
    635 #define _ATTRIBUTE(x) __attribute__((x))
    636 #define _LIBCPP_NORETURN __attribute__((noreturn))
    637 
    638 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    639 #define _LIBCPP_HAS_NO_NOEXCEPT
    640 #define _LIBCPP_HAS_NO_NULLPTR
    641 #define _LIBCPP_HAS_NO_UNICODE_CHARS
    642 #define _LIBCPP_HAS_IS_BASE_OF
    643 #define _LIBCPP_HAS_IS_FINAL
    644 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
    645 
    646 #if defined(_AIX)
    647 #define __MULTILOCALE_API
    648 #endif
    649 
    650 #define _LIBCPP_HAS_NO_ASAN
    651 
    652 #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
    653 
    654 #define _LIBCPP_HAS_NO_VECTOR_EXTENSION
    655 
    656 #endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM]
    657 
    658 #if defined(_LIBCPP_OBJECT_FORMAT_COFF)
    659 
    660 #ifdef _DLL
    661 #  define _LIBCPP_CRT_FUNC __declspec(dllimport)
    662 #else
    663 #  define _LIBCPP_CRT_FUNC
    664 #endif
    665 
    666 #if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
    667 #  define _LIBCPP_DLL_VIS
    668 #  define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
    669 #  define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
    670 #  define _LIBCPP_OVERRIDABLE_FUNC_VIS
    671 #  define _LIBCPP_EXPORTED_FROM_ABI
    672 #elif defined(_LIBCPP_BUILDING_LIBRARY)
    673 #  define _LIBCPP_DLL_VIS __declspec(dllexport)
    674 #  define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
    675 #  define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS
    676 #  define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_DLL_VIS
    677 #  define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllexport)
    678 #else
    679 #  define _LIBCPP_DLL_VIS __declspec(dllimport)
    680 #  define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS
    681 #  define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
    682 #  define _LIBCPP_OVERRIDABLE_FUNC_VIS
    683 #  define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllimport)
    684 #endif
    685 
    686 #define _LIBCPP_TYPE_VIS            _LIBCPP_DLL_VIS
    687 #define _LIBCPP_FUNC_VIS            _LIBCPP_DLL_VIS
    688 #define _LIBCPP_EXCEPTION_ABI       _LIBCPP_DLL_VIS
    689 #define _LIBCPP_HIDDEN
    690 #define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
    691 #define _LIBCPP_TEMPLATE_VIS
    692 #define _LIBCPP_ENUM_VIS
    693 
    694 #endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)
    695 
    696 #ifndef _LIBCPP_HIDDEN
    697 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
    698 #    define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
    699 #  else
    700 #    define _LIBCPP_HIDDEN
    701 #  endif
    702 #endif
    703 
    704 #ifndef _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
    705 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
    706 // The inline should be removed once PR32114 is resolved
    707 #    define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS inline _LIBCPP_HIDDEN
    708 #  else
    709 #    define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
    710 #  endif
    711 #endif
    712 
    713 #ifndef _LIBCPP_FUNC_VIS
    714 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
    715 #    define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
    716 #  else
    717 #    define _LIBCPP_FUNC_VIS
    718 #  endif
    719 #endif
    720 
    721 #ifndef _LIBCPP_TYPE_VIS
    722 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
    723 #    define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
    724 #  else
    725 #    define _LIBCPP_TYPE_VIS
    726 #  endif
    727 #endif
    728 
    729 #ifndef _LIBCPP_TEMPLATE_VIS
    730 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
    731 #    if __has_attribute(__type_visibility__)
    732 #      define _LIBCPP_TEMPLATE_VIS __attribute__ ((__type_visibility__("default")))
    733 #    else
    734 #      define _LIBCPP_TEMPLATE_VIS __attribute__ ((__visibility__("default")))
    735 #    endif
    736 #  else
    737 #    define _LIBCPP_TEMPLATE_VIS
    738 #  endif
    739 #endif
    740 
    741 #ifndef _LIBCPP_EXPORTED_FROM_ABI
    742 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
    743 #    define _LIBCPP_EXPORTED_FROM_ABI __attribute__((__visibility__("default")))
    744 #  else
    745 #    define _LIBCPP_EXPORTED_FROM_ABI
    746 #  endif
    747 #endif
    748 
    749 #ifndef _LIBCPP_OVERRIDABLE_FUNC_VIS
    750 #define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_FUNC_VIS
    751 #endif
    752 
    753 #ifndef _LIBCPP_EXCEPTION_ABI
    754 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
    755 #    define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
    756 #  else
    757 #    define _LIBCPP_EXCEPTION_ABI
    758 #  endif
    759 #endif
    760 
    761 #ifndef _LIBCPP_ENUM_VIS
    762 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
    763 #    define _LIBCPP_ENUM_VIS __attribute__ ((__type_visibility__("default")))
    764 #  else
    765 #    define _LIBCPP_ENUM_VIS
    766 #  endif
    767 #endif
    768 
    769 #ifndef _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
    770 #  if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
    771 #    define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __attribute__ ((__visibility__("default")))
    772 #  else
    773 #    define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
    774 #  endif
    775 #endif
    776 
    777 #ifndef _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
    778 #define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
    779 #endif
    780 
    781 #if __has_attribute(internal_linkage)
    782 #  define _LIBCPP_INTERNAL_LINKAGE __attribute__ ((internal_linkage))
    783 #else
    784 #  define _LIBCPP_INTERNAL_LINKAGE _LIBCPP_ALWAYS_INLINE
    785 #endif
    786 
    787 #if __has_attribute(exclude_from_explicit_instantiation)
    788 #  define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__ ((__exclude_from_explicit_instantiation__))
    789 #else
    790    // Try to approximate the effect of exclude_from_explicit_instantiation
    791    // (which is that entities are not assumed to be provided by explicit
    792    // template instantitations in the dylib) by always inlining those entities.
    793 #  define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCPP_ALWAYS_INLINE
    794 #endif
    795 
    796 #ifndef _LIBCPP_HIDE_FROM_ABI_PER_TU
    797 #  ifndef _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
    798 #    define _LIBCPP_HIDE_FROM_ABI_PER_TU 0
    799 #  else
    800 #    define _LIBCPP_HIDE_FROM_ABI_PER_TU 1
    801 #  endif
    802 #endif
    803 
    804 #ifndef _LIBCPP_HIDE_FROM_ABI
    805 #  if _LIBCPP_HIDE_FROM_ABI_PER_TU
    806 #    define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE
    807 #  else
    808 #    define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
    809 #  endif
    810 #endif
    811 
    812 #ifdef _LIBCPP_BUILDING_LIBRARY
    813 #  if _LIBCPP_ABI_VERSION > 1
    814 #    define _LIBCPP_HIDE_FROM_ABI_AFTER_V1 _LIBCPP_HIDE_FROM_ABI
    815 #  else
    816 #    define _LIBCPP_HIDE_FROM_ABI_AFTER_V1
    817 #  endif
    818 #else
    819 #  define _LIBCPP_HIDE_FROM_ABI_AFTER_V1 _LIBCPP_HIDE_FROM_ABI
    820 #endif
    821 
    822 // Just so we can migrate to the new macros gradually.
    823 #define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
    824 
    825 // Inline namespaces are available in Clang/GCC/MSVC regardless of C++ dialect.
    826 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { inline namespace _LIBCPP_ABI_NAMESPACE {
    827 #define _LIBCPP_END_NAMESPACE_STD  } }
    828 #define _VSTD std::_LIBCPP_ABI_NAMESPACE
    829 _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
    830 
    831 #if _LIBCPP_STD_VER >= 17
    832 #define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM \
    833   _LIBCPP_BEGIN_NAMESPACE_STD inline namespace __fs { namespace filesystem {
    834 #else
    835 #define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM \
    836   _LIBCPP_BEGIN_NAMESPACE_STD namespace __fs { namespace filesystem {
    837 #endif
    838 
    839 #define _LIBCPP_END_NAMESPACE_FILESYSTEM \
    840   _LIBCPP_END_NAMESPACE_STD } }
    841 
    842 #define _VSTD_FS _VSTD::__fs::filesystem
    843 
    844 #ifndef _LIBCPP_PREFERRED_OVERLOAD
    845 #  if __has_attribute(__enable_if__)
    846 #    define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, "")))
    847 #  endif
    848 #endif
    849 
    850 #ifndef _LIBCPP_HAS_NO_NOEXCEPT
    851 #  define _NOEXCEPT noexcept
    852 #  define _NOEXCEPT_(x) noexcept(x)
    853 #else
    854 #  define _NOEXCEPT throw()
    855 #  define _NOEXCEPT_(x)
    856 #endif
    857 
    858 #if defined(_LIBCPP_DEBUG_USE_EXCEPTIONS)
    859 #  if !defined(_LIBCPP_DEBUG)
    860 #    error cannot use _LIBCPP_DEBUG_USE_EXCEPTIONS unless _LIBCPP_DEBUG is defined
    861 #  endif
    862 #  ifdef _LIBCPP_HAS_NO_NOEXCEPT
    863 #    define _NOEXCEPT_DEBUG
    864 #    define _NOEXCEPT_DEBUG_(x)
    865 #  else
    866 #    define _NOEXCEPT_DEBUG noexcept(false)
    867 #    define _NOEXCEPT_DEBUG_(x) noexcept(false)
    868 #  endif
    869 #else
    870 #  define _NOEXCEPT_DEBUG _NOEXCEPT
    871 #  define _NOEXCEPT_DEBUG_(x) _NOEXCEPT_(x)
    872 #endif
    873 
    874 #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
    875 typedef unsigned short char16_t;
    876 typedef unsigned int   char32_t;
    877 #endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
    878 
    879 #ifndef __SIZEOF_INT128__
    880 #define _LIBCPP_HAS_NO_INT128
    881 #endif
    882 
    883 #ifdef _LIBCPP_CXX03_LANG
    884 #  if __has_extension(c_static_assert)
    885 #    define static_assert(__b, __m) _Static_assert(__b, __m)
    886 #  else
    887 extern "C++" {
    888 template <bool> struct __static_assert_test;
    889 template <> struct __static_assert_test<true> {};
    890 template <unsigned> struct __static_assert_check {};
    891 }
    892 #    define static_assert(__b, __m) \
    893        typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
    894        _LIBCPP_CONCAT(__t, __LINE__)
    895 #  endif // __has_extension(c_static_assert)
    896 #endif  // _LIBCPP_CXX03_LANG
    897 
    898 #ifdef _LIBCPP_HAS_NO_DECLTYPE
    899 // GCC 4.6 provides __decltype in all standard modes.
    900 #  if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406
    901 #    define decltype(__x) __decltype(__x)
    902 #  else
    903 #    define decltype(__x) __typeof__(__x)
    904 #  endif
    905 #endif
    906 
    907 #ifdef _LIBCPP_HAS_NO_CONSTEXPR
    908 #  define _LIBCPP_CONSTEXPR
    909 #else
    910 #  define _LIBCPP_CONSTEXPR constexpr
    911 #endif
    912 
    913 #ifdef _LIBCPP_CXX03_LANG
    914 #  define _LIBCPP_DEFAULT {}
    915 #else
    916 #  define _LIBCPP_DEFAULT = default;
    917 #endif
    918 
    919 #ifdef _LIBCPP_CXX03_LANG
    920 #  define _LIBCPP_EQUAL_DELETE
    921 #else
    922 #  define _LIBCPP_EQUAL_DELETE = delete
    923 #endif
    924 
    925 #ifdef __GNUC__
    926 #  define _NOALIAS __attribute__((__malloc__))
    927 #else
    928 #  define _NOALIAS
    929 #endif
    930 
    931 #if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || \
    932     (!defined(_LIBCPP_CXX03_LANG) && defined(__GNUC__)) // All supported GCC versions
    933 #  define _LIBCPP_EXPLICIT explicit
    934 #else
    935 #  define _LIBCPP_EXPLICIT
    936 #endif
    937 
    938 #if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete)
    939 #define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
    940 #endif
    941 
    942 #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
    943 #  define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
    944 #  define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
    945      __lx __v_; \
    946      _LIBCPP_INLINE_VISIBILITY x(__lx __v) : __v_(__v) {} \
    947      _LIBCPP_INLINE_VISIBILITY explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
    948      _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;} \
    949      };
    950 #else  // _LIBCPP_HAS_NO_STRONG_ENUMS
    951 #  define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_ENUM_VIS x
    952 #  define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
    953 #endif  // _LIBCPP_HAS_NO_STRONG_ENUMS
    954 
    955 #ifdef _LIBCPP_DEBUG
    956 #  if _LIBCPP_DEBUG == 0
    957 #    define _LIBCPP_DEBUG_LEVEL 1
    958 #  elif _LIBCPP_DEBUG == 1
    959 #    define _LIBCPP_DEBUG_LEVEL 2
    960 #  else
    961 #    error Supported values for _LIBCPP_DEBUG are 0 and 1
    962 #  endif
    963 #  if !defined(_LIBCPP_BUILDING_LIBRARY)
    964 #    define _LIBCPP_EXTERN_TEMPLATE(...)
    965 #  endif
    966 #endif
    967 
    968 #ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE
    969 #define _LIBCPP_EXTERN_TEMPLATE(...)
    970 #define _LIBCPP_EXTERN_TEMPLATE2(...)
    971 #endif
    972 
    973 #ifndef _LIBCPP_EXTERN_TEMPLATE
    974 #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
    975 #endif
    976 
    977 #ifndef _LIBCPP_EXTERN_TEMPLATE2
    978 #define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__;
    979 #endif
    980 
    981 #if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__)
    982 #define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63)
    983 #endif
    984 
    985 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || \
    986     defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__)
    987 #define _LIBCPP_LOCALE__L_EXTENSIONS 1
    988 #endif
    989 
    990 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
    991 // Most unix variants have catopen.  These are the specific ones that don't.
    992 #  if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
    993 #    define _LIBCPP_HAS_CATOPEN 1
    994 #  endif
    995 #endif
    996 
    997 #ifdef __FreeBSD__
    998 #define _DECLARE_C99_LDBL_MATH 1
    999 #endif
   1000 
   1001 // If we are getting operator new from the MSVC CRT, then allocation overloads
   1002 // for align_val_t were added in 19.12, aka VS 2017 version 15.3.
   1003 #if defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912 && !defined(_LIBCPP_NO_VCRUNTIME)
   1004 #  define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
   1005 #  define _LIBCPP_DEFER_NEW_TO_VCRUNTIME
   1006 #elif defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
   1007 #  define _LIBCPP_DEFER_NEW_TO_VCRUNTIME
   1008 #  if !defined(__cpp_aligned_new)
   1009      // We're defering to Microsoft's STL to provide aligned new et al. We don't
   1010      // have it unless the language feature test macro is defined.
   1011 #    define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
   1012 #  endif
   1013 #endif
   1014 
   1015 #if defined(__APPLE__)
   1016 #  if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
   1017       defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
   1018 #    define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
   1019 #  endif
   1020 #endif // defined(__APPLE__)
   1021 
   1022 #if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) && \
   1023     (defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) || \
   1024     (!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606))
   1025 #  define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
   1026 #endif
   1027 
   1028 #if defined(__APPLE__) || defined(__FreeBSD__)
   1029 #define _LIBCPP_HAS_DEFAULTRUNELOCALE
   1030 #endif
   1031 
   1032 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
   1033 #define _LIBCPP_WCTYPE_IS_MASK
   1034 #endif
   1035 
   1036 #if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t)
   1037 #define _LIBCPP_NO_HAS_CHAR8_T
   1038 #endif
   1039 
   1040 // Deprecation macros.
   1041 // Deprecations warnings are only enabled when _LIBCPP_ENABLE_DEPRECATION_WARNINGS is defined.
   1042 #if defined(_LIBCPP_ENABLE_DEPRECATION_WARNINGS)
   1043 #  if __has_attribute(deprecated)
   1044 #    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
   1045 #  elif _LIBCPP_STD_VER > 11
   1046 #    define _LIBCPP_DEPRECATED [[deprecated]]
   1047 #  else
   1048 #    define _LIBCPP_DEPRECATED
   1049 #  endif
   1050 #else
   1051 #  define _LIBCPP_DEPRECATED
   1052 #endif
   1053 
   1054 #if !defined(_LIBCPP_CXX03_LANG)
   1055 #  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
   1056 #else
   1057 #  define _LIBCPP_DEPRECATED_IN_CXX11
   1058 #endif
   1059 
   1060 #if _LIBCPP_STD_VER >= 14
   1061 #  define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
   1062 #else
   1063 #  define _LIBCPP_DEPRECATED_IN_CXX14
   1064 #endif
   1065 
   1066 #if _LIBCPP_STD_VER >= 17
   1067 #  define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
   1068 #else
   1069 #  define _LIBCPP_DEPRECATED_IN_CXX17
   1070 #endif
   1071 
   1072 #if _LIBCPP_STD_VER <= 11
   1073 #  define _LIBCPP_EXPLICIT_AFTER_CXX11
   1074 #else
   1075 #  define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
   1076 #endif
   1077 
   1078 #if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
   1079 #  define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
   1080 #else
   1081 #  define _LIBCPP_CONSTEXPR_AFTER_CXX11
   1082 #endif
   1083 
   1084 #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
   1085 #  define _LIBCPP_CONSTEXPR_AFTER_CXX14 constexpr
   1086 #else
   1087 #  define _LIBCPP_CONSTEXPR_AFTER_CXX14
   1088 #endif
   1089 
   1090 #if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
   1091 #  define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr
   1092 #else
   1093 #  define _LIBCPP_CONSTEXPR_AFTER_CXX17
   1094 #endif
   1095 
   1096 // The _LIBCPP_NODISCARD_ATTRIBUTE should only be used to define other
   1097 // NODISCARD macros to the correct attribute.
   1098 #if __has_cpp_attribute(nodiscard) || defined(_LIBCPP_COMPILER_MSVC)
   1099 #  define _LIBCPP_NODISCARD_ATTRIBUTE [[nodiscard]]
   1100 #elif defined(_LIBCPP_COMPILER_CLANG) && !defined(_LIBCPP_CXX03_LANG)
   1101 #  define _LIBCPP_NODISCARD_ATTRIBUTE [[clang::warn_unused_result]]
   1102 #else
   1103 // We can't use GCC's [[gnu::warn_unused_result]] and
   1104 // __attribute__((warn_unused_result)), because GCC does not silence them via
   1105 // (void) cast.
   1106 #  define _LIBCPP_NODISCARD_ATTRIBUTE
   1107 #endif
   1108 
   1109 // _LIBCPP_NODISCARD_EXT may be used to apply [[nodiscard]] to entities not
   1110 // specified as such as an extension.
   1111 #if defined(_LIBCPP_ENABLE_NODISCARD) && !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
   1112 #  define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD_ATTRIBUTE
   1113 #else
   1114 #  define _LIBCPP_NODISCARD_EXT
   1115 #endif
   1116 
   1117 #if !defined(_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17) && \
   1118     (_LIBCPP_STD_VER > 17 || defined(_LIBCPP_ENABLE_NODISCARD))
   1119 #  define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD_ATTRIBUTE
   1120 #else
   1121 #  define _LIBCPP_NODISCARD_AFTER_CXX17
   1122 #endif
   1123 
   1124 #if _LIBCPP_STD_VER > 14 && defined(__cpp_inline_variables) && (__cpp_inline_variables >= 201606L)
   1125 #  define _LIBCPP_INLINE_VAR inline
   1126 #else
   1127 #  define _LIBCPP_INLINE_VAR
   1128 #endif
   1129 
   1130 #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
   1131 #  define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
   1132 #else
   1133 #  define _LIBCPP_EXPLICIT_MOVE(x) (x)
   1134 #endif
   1135 
   1136 #ifndef _LIBCPP_CONSTEXPR_IF_NODEBUG
   1137 #if defined(_LIBCPP_DEBUG) || defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
   1138 #define _LIBCPP_CONSTEXPR_IF_NODEBUG
   1139 #else
   1140 #define _LIBCPP_CONSTEXPR_IF_NODEBUG constexpr
   1141 #endif
   1142 #endif
   1143 
   1144 #ifndef _LIBCPP_HAS_NO_ASAN
   1145 _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
   1146   const void *, const void *, const void *, const void *);
   1147 #endif
   1148 
   1149 // Try to find out if RTTI is disabled.
   1150 // g++ and cl.exe have RTTI on by default and define a macro when it is.
   1151 // g++ only defines the macro in 4.3.2 and onwards.
   1152 #if !defined(_LIBCPP_NO_RTTI)
   1153 #  if defined(__GNUC__) && \
   1154       ((__GNUC__ >= 5) || \
   1155        (__GNUC__ == 4 && (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && \
   1156       !defined(__GXX_RTTI)
   1157 #    define _LIBCPP_NO_RTTI
   1158 #  elif defined(_LIBCPP_COMPILER_MSVC) && !defined(_CPPRTTI)
   1159 #    define _LIBCPP_NO_RTTI
   1160 #  endif
   1161 #endif
   1162 
   1163 #ifndef _LIBCPP_WEAK
   1164 #define _LIBCPP_WEAK __attribute__((__weak__))
   1165 #endif
   1166 
   1167 // Thread API
   1168 #if !defined(_LIBCPP_HAS_NO_THREADS) && \
   1169     !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \
   1170     !defined(_LIBCPP_HAS_THREAD_API_WIN32) && \
   1171     !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
   1172 #  if defined(__FreeBSD__) || \
   1173       defined(__Fuchsia__) || \
   1174       defined(__NetBSD__) || \
   1175       defined(__linux__) || \
   1176       defined(__GNU__) || \
   1177       defined(__APPLE__) || \
   1178       defined(__CloudABI__) || \
   1179       defined(__sun__) || \
   1180       (defined(__MINGW32__) && __has_include(<pthread.h>))
   1181 #    define _LIBCPP_HAS_THREAD_API_PTHREAD
   1182 #  elif defined(_LIBCPP_WIN32API)
   1183 #    define _LIBCPP_HAS_THREAD_API_WIN32
   1184 #  else
   1185 #    error "No thread API"
   1186 #  endif // _LIBCPP_HAS_THREAD_API
   1187 #endif // _LIBCPP_HAS_NO_THREADS
   1188 
   1189 #if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
   1190 #error _LIBCPP_HAS_THREAD_API_PTHREAD may only be defined when \
   1191        _LIBCPP_HAS_NO_THREADS is not defined.
   1192 #endif
   1193 
   1194 #if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
   1195 #error _LIBCPP_HAS_THREAD_API_EXTERNAL may not be defined when \
   1196        _LIBCPP_HAS_NO_THREADS is defined.
   1197 #endif
   1198 
   1199 #if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS)
   1200 #error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \
   1201        _LIBCPP_HAS_NO_THREADS is defined.
   1202 #endif
   1203 
   1204 // Systems that use capability-based security (FreeBSD with Capsicum,
   1205 // Nuxi CloudABI) may only provide local filesystem access (using *at()).
   1206 // Functions like open(), rename(), unlink() and stat() should not be
   1207 // used, as they attempt to access the global filesystem namespace.
   1208 #ifdef __CloudABI__
   1209 #define _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
   1210 #endif
   1211 
   1212 // CloudABI is intended for running networked services. Processes do not
   1213 // have standard input and output channels.
   1214 #ifdef __CloudABI__
   1215 #define _LIBCPP_HAS_NO_STDIN
   1216 #define _LIBCPP_HAS_NO_STDOUT
   1217 #endif
   1218 
   1219 #if defined(__BIONIC__) || defined(__CloudABI__) ||                            \
   1220     defined(__Fuchsia__) || defined(_LIBCPP_HAS_MUSL_LIBC)
   1221 #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
   1222 #endif
   1223 
   1224 // Thread-unsafe functions such as strtok() and localtime()
   1225 // are not available.
   1226 #ifdef __CloudABI__
   1227 #define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
   1228 #endif
   1229 
   1230 #if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic)
   1231 #  define _LIBCPP_HAS_C_ATOMIC_IMP
   1232 #elif _GNUC_VER > 407
   1233 #  define _LIBCPP_HAS_GCC_ATOMIC_IMP
   1234 #endif
   1235 
   1236 #if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \
   1237      || defined(_LIBCPP_HAS_NO_THREADS)
   1238 #define _LIBCPP_HAS_NO_ATOMIC_HEADER
   1239 #endif
   1240 
   1241 #ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
   1242 #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
   1243 #endif
   1244 
   1245 #if defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS)
   1246 #  if defined(__clang__) && __has_attribute(acquire_capability)
   1247 // Work around the attribute handling in clang.  When both __declspec and
   1248 // __attribute__ are present, the processing goes awry preventing the definition
   1249 // of the types.
   1250 #    if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
   1251 #      define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
   1252 #    endif
   1253 #  endif
   1254 #endif
   1255 
   1256 #if __has_attribute(require_constant_initialization)
   1257 #  define _LIBCPP_SAFE_STATIC __attribute__((__require_constant_initialization__))
   1258 #else
   1259 #  define _LIBCPP_SAFE_STATIC
   1260 #endif
   1261 
   1262 #if !__has_builtin(__builtin_addressof) && _GNUC_VER < 700
   1263 #define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
   1264 #endif
   1265 
   1266 #if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
   1267 #  if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION)
   1268 #    define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
   1269 #  endif
   1270 #endif
   1271 
   1272 #if __has_attribute(diagnose_if) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS)
   1273 #  define _LIBCPP_DIAGNOSE_WARNING(...) \
   1274      __attribute__((diagnose_if(__VA_ARGS__, "warning")))
   1275 #  define _LIBCPP_DIAGNOSE_ERROR(...) \
   1276      __attribute__((diagnose_if(__VA_ARGS__, "error")))
   1277 #else
   1278 #  define _LIBCPP_DIAGNOSE_WARNING(...)
   1279 #  define _LIBCPP_DIAGNOSE_ERROR(...)
   1280 #endif
   1281 
   1282 // Use a function like macro to imply that it must be followed by a semicolon
   1283 #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
   1284 #  define _LIBCPP_FALLTHROUGH() [[fallthrough]]
   1285 #elif __has_cpp_attribute(clang::fallthrough)
   1286 #  define _LIBCPP_FALLTHROUGH() [[clang::fallthrough]]
   1287 #elif __has_attribute(fallthough) || _GNUC_VER >= 700
   1288 #  define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__))
   1289 #else
   1290 #  define _LIBCPP_FALLTHROUGH() ((void)0)
   1291 #endif
   1292 
   1293 #if defined(_LIBCPP_ABI_MICROSOFT) && \
   1294     (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
   1295 #  define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
   1296 #else
   1297 #  define _LIBCPP_DECLSPEC_EMPTY_BASES
   1298 #endif
   1299 
   1300 #if defined(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES)
   1301 #define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
   1302 #define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
   1303 #define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
   1304 #define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS
   1305 #endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
   1306 
   1307 #if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611
   1308 #define _LIBCPP_HAS_NO_DEDUCTION_GUIDES
   1309 #endif
   1310 
   1311 #if !__has_keyword(__is_aggregate) && (_GNUC_VER_NEW < 7001)
   1312 #define _LIBCPP_HAS_NO_IS_AGGREGATE
   1313 #endif
   1314 
   1315 #if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
   1316 #define _LIBCPP_HAS_NO_COROUTINES
   1317 #endif
   1318 
   1319 // FIXME: Correct this macro when either (A) a feature test macro for the
   1320 // spaceship operator is provided, or (B) a compiler provides a complete
   1321 // implementation.
   1322 #define _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
   1323 
   1324 // Decide whether to use availability macros.
   1325 #if !defined(_LIBCPP_BUILDING_LIBRARY) &&                                      \
   1326     !defined(_LIBCPP_DISABLE_AVAILABILITY) &&                                  \
   1327     __has_feature(attribute_availability_with_strict) &&                       \
   1328     __has_feature(attribute_availability_in_templates)
   1329 #  ifdef __APPLE__
   1330 #    define _LIBCPP_USE_AVAILABILITY_APPLE
   1331 #  endif
   1332 #endif
   1333 
   1334 // Define availability macros.
   1335 #if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
   1336 #  define _LIBCPP_AVAILABILITY_SHARED_MUTEX                                    \
   1337      __attribute__((availability(macosx,strict,introduced=10.12)))             \
   1338      __attribute__((availability(ios,strict,introduced=10.0)))                 \
   1339      __attribute__((availability(tvos,strict,introduced=10.0)))                \
   1340      __attribute__((availability(watchos,strict,introduced=3.0)))
   1341 #  define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS                             \
   1342      __attribute__((availability(macosx,strict,introduced=10.14)))             \
   1343      __attribute__((availability(ios,strict,introduced=12.0)))                 \
   1344      __attribute__((availability(tvos,strict,introduced=12.0)))                \
   1345      __attribute__((availability(watchos,strict,introduced=5.0)))
   1346 #  define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS                              \
   1347      _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
   1348 #  define _LIBCPP_AVAILABILITY_BAD_ANY_CAST                                    \
   1349      _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
   1350 #  define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS                             \
   1351      __attribute__((availability(macosx,strict,introduced=10.12)))             \
   1352      __attribute__((availability(ios,strict,introduced=10.0)))                 \
   1353      __attribute__((availability(tvos,strict,introduced=10.0)))                \
   1354      __attribute__((availability(watchos,strict,introduced=3.0)))
   1355 #  define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE                                \
   1356      __attribute__((availability(macosx,strict,introduced=10.12)))             \
   1357      __attribute__((availability(ios,strict,introduced=10.0)))                 \
   1358      __attribute__((availability(tvos,strict,introduced=10.0)))                \
   1359      __attribute__((availability(watchos,strict,introduced=3.0)))
   1360 #  define _LIBCPP_AVAILABILITY_FUTURE_ERROR                                    \
   1361      __attribute__((availability(ios,strict,introduced=6.0)))
   1362 #  define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE                                 \
   1363      __attribute__((availability(macosx,strict,introduced=10.9)))              \
   1364      __attribute__((availability(ios,strict,introduced=7.0)))
   1365 #  define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY                                 \
   1366      __attribute__((availability(macosx,strict,introduced=10.9)))              \
   1367      __attribute__((availability(ios,strict,introduced=7.0)))
   1368 #  define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR                               \
   1369      __attribute__((availability(macosx,strict,introduced=10.9)))              \
   1370      __attribute__((availability(ios,strict,introduced=7.0)))
   1371 #else
   1372 #  define _LIBCPP_AVAILABILITY_SHARED_MUTEX
   1373 #  define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
   1374 #  define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
   1375 #  define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
   1376 #  define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
   1377 #  define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
   1378 #  define _LIBCPP_AVAILABILITY_FUTURE_ERROR
   1379 #  define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
   1380 #  define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
   1381 #  define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
   1382 #endif
   1383 
   1384 // Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
   1385 #ifdef _LIBCPP_NO_EXCEPTIONS
   1386 #  define _LIBCPP_AVAILABILITY_FUTURE
   1387 #  define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
   1388 #  define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   1389 #  define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
   1390 #else
   1391 #  define _LIBCPP_AVAILABILITY_FUTURE                    _LIBCPP_AVAILABILITY_FUTURE_ERROR
   1392 #  define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST        _LIBCPP_AVAILABILITY_BAD_ANY_CAST
   1393 #  define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
   1394 #  define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS  _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
   1395 #endif
   1396 
   1397 // The stream API was dropped and re-added in the dylib shipped on macOS
   1398 // and iOS. We can only assume the dylib to provide these definitions for
   1399 // macosx >= 10.9 and ios >= 7.0. Otherwise, the definitions are available
   1400 // from the headers, but not from the dylib. Explicit instantiation
   1401 // declarations for streams exist conditionally to this; if we provide
   1402 // an explicit instantiation declaration and we try to deploy to a dylib
   1403 // that does not provide those symbols, we'll get a load-time error.
   1404 #if !defined(_LIBCPP_BUILDING_LIBRARY) &&                                      \
   1405     ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) &&                \
   1406       __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090) ||                 \
   1407      (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) &&               \
   1408       __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000))
   1409 #  define _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
   1410 #endif
   1411 
   1412 #if defined(_LIBCPP_COMPILER_IBM)
   1413 #define _LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO
   1414 #endif
   1415 
   1416 #if defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO)
   1417 #  define _LIBCPP_PUSH_MACROS
   1418 #  define _LIBCPP_POP_MACROS
   1419 #else
   1420   // Don't warn about macro conflicts when we can restore them at the
   1421   // end of the header.
   1422 #  ifndef _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS
   1423 #    define _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS
   1424 #  endif
   1425 #  if defined(_LIBCPP_COMPILER_MSVC)
   1426 #    define _LIBCPP_PUSH_MACROS    \
   1427        __pragma(push_macro("min")) \
   1428        __pragma(push_macro("max"))
   1429 #    define _LIBCPP_POP_MACROS     \
   1430        __pragma(pop_macro("min"))  \
   1431        __pragma(pop_macro("max"))
   1432 #  else
   1433 #    define _LIBCPP_PUSH_MACROS        \
   1434        _Pragma("push_macro(\"min\")")  \
   1435        _Pragma("push_macro(\"max\")")
   1436 #    define _LIBCPP_POP_MACROS         \
   1437        _Pragma("pop_macro(\"min\")")   \
   1438        _Pragma("pop_macro(\"max\")")
   1439 #  endif
   1440 #endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO)
   1441 
   1442 #ifndef _LIBCPP_NO_AUTO_LINK
   1443 #  if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
   1444 #    if defined(_DLL)
   1445 #      pragma comment(lib, "c++.lib")
   1446 #    else
   1447 #      pragma comment(lib, "libc++.lib")
   1448 #    endif
   1449 #  endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
   1450 #endif // _LIBCPP_NO_AUTO_LINK
   1451 
   1452 #define _LIBCPP_UNUSED_VAR(x) ((void)(x))
   1453 
   1454 #endif // __cplusplus
   1455 
   1456 #endif // _LIBCPP_CONFIG