3838# define _LIBCPP_ABI_VERSION 1
3939#endif
4040
41+ #ifndef __STDC_HOSTED__
42+ # define _LIBCPP_FREESTANDING
43+ #endif
44+
4145#ifndef _LIBCPP_STD_VER
4246# if __cplusplus <= 201103L
4347# define _LIBCPP_STD_VER 11
9296// Enable optimized version of __do_get_(un)signed which avoids redundant copies.
9397# define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
9498// Use the smallest possible integer type to represent the index of the variant.
95- // Previously libc++ used "unsigned int" exclusivly .
99+ // Previously libc++ used "unsigned int" exclusively .
96100# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
97101// Unstable attempt to provide a more optimized std::function
98102# define _LIBCPP_ABI_OPTIMIZED_FUNCTION
103+ // All the regex constants must be distinct and nonzero.
104+ # define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO
99105#elif _LIBCPP_ABI_VERSION == 1
100106# if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
101107// Enable compiling copies of now inline methods into the dylib to support
200206# endif
201207#endif
202208
209+ #if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
210+ # define _LIBCPP_ABI_VCRUNTIME
211+ #endif
212+
203213// Need to detect which libc we're using if we're on Linux.
204214#if defined(__linux__)
205215# include < features.h>
256266# define _LIBCPP_WIN32API
257267# define _LIBCPP_LITTLE_ENDIAN
258268# define _LIBCPP_SHORT_WCHAR 1
259- // Both MinGW and native MSVC provide a "MSVC"-like enviroment
269+ // Both MinGW and native MSVC provide a "MSVC"-like environment
260270# define _LIBCPP_MSVCRT_LIKE
261271// If mingw not explicitly detected, assume using MS C runtime only if
262272// a MS compatibility version is specified.
@@ -776,7 +786,7 @@ typedef __char32_t char32_t;
776786#else
777787 // Try to approximate the effect of exclude_from_explicit_instantiation
778788 // (which is that entities are not assumed to be provided by explicit
779- // template instantitations in the dylib) by always inlining those entities.
789+ // template instantiations in the dylib) by always inlining those entities.
780790# define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCPP_ALWAYS_INLINE
781791#endif
782792
@@ -842,22 +852,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
842852# define _NOEXCEPT_ (x )
843853#endif
844854
845- #if defined(_LIBCPP_DEBUG_USE_EXCEPTIONS)
846- # if !defined(_LIBCPP_DEBUG)
847- # error cannot use _LIBCPP_DEBUG_USE_EXCEPTIONS unless _LIBCPP_DEBUG is defined
848- # endif
849- # ifdef _LIBCPP_HAS_NO_NOEXCEPT
850- # define _NOEXCEPT_DEBUG
851- # define _NOEXCEPT_DEBUG_ (x )
852- # else
853- # define _NOEXCEPT_DEBUG noexcept (false )
854- # define _NOEXCEPT_DEBUG_ (x ) noexcept (false )
855- # endif
856- #else
857- # define _NOEXCEPT_DEBUG _NOEXCEPT
858- # define _NOEXCEPT_DEBUG_ (x ) _NOEXCEPT_(x)
859- #endif
860-
861855#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
862856typedef unsigned short char16_t ;
863857typedef unsigned int char32_t ;
@@ -910,9 +904,9 @@ template <unsigned> struct __static_assert_check {};
910904#endif
911905
912906#ifdef __GNUC__
913- # define _NOALIAS __attribute__ ((__malloc__))
907+ # define _LIBCPP_NOALIAS __attribute__ ((__malloc__))
914908#else
915- # define _NOALIAS
909+ # define _LIBCPP_NOALIAS
916910#endif
917911
918912#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || \
@@ -985,16 +979,12 @@ template <unsigned> struct __static_assert_check {};
985979#define _DECLARE_C99_LDBL_MATH 1
986980#endif
987981
988- #if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
989- # define _LIBCPP_DEFER_NEW_TO_VCRUNTIME
990- #endif
991-
992982// If we are getting operator new from the MSVC CRT, then allocation overloads
993983// for align_val_t were added in 19.12, aka VS 2017 version 15.3.
994984#if defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912
995985# define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
996- #elif defined(_LIBCPP_DEFER_NEW_TO_VCRUNTIME ) && !defined(__cpp_aligned_new)
997- // We're defering to Microsoft's STL to provide aligned new et al. We don't
986+ #elif defined(_LIBCPP_ABI_VCRUNTIME ) && !defined(__cpp_aligned_new)
987+ // We're deferring to Microsoft's STL to provide aligned new et al. We don't
998988 // have it unless the language feature test macro is defined.
999989# define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
1000990#endif
@@ -1025,8 +1015,10 @@ template <unsigned> struct __static_assert_check {};
10251015#endif
10261016
10271017// Deprecation macros.
1028- // Deprecations warnings are only enabled when _LIBCPP_ENABLE_DEPRECATION_WARNINGS is defined.
1029- #if defined(_LIBCPP_ENABLE_DEPRECATION_WARNINGS)
1018+ //
1019+ // Deprecations warnings are always enabled, except when users explicitly opt-out
1020+ // by defining _LIBCPP_DISABLE_DEPRECATION_WARNINGS.
1021+ #if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
10301022# if __has_attribute(deprecated)
10311023# define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
10321024# elif _LIBCPP_STD_VER > 11
@@ -1220,9 +1212,18 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
12201212# define _LIBCPP_HAS_GCC_ATOMIC_IMP
12211213#endif
12221214
1223- #if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \
1215+ #if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && \
1216+ !defined (_LIBCPP_HAS_GCC_ATOMIC_IMP) && \
1217+ !defined (_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP)) \
12241218 || defined (_LIBCPP_HAS_NO_THREADS)
1225- #define _LIBCPP_HAS_NO_ATOMIC_HEADER
1219+ # define _LIBCPP_HAS_NO_ATOMIC_HEADER
1220+ #else
1221+ # ifndef _LIBCPP_ATOMIC_FLAG_TYPE
1222+ # define _LIBCPP_ATOMIC_FLAG_TYPE bool
1223+ # endif
1224+ # ifdef _LIBCPP_FREESTANDING
1225+ # define _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
1226+ # endif
12261227#endif
12271228
12281229#ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
@@ -1312,7 +1313,8 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
13121313#if !defined(_LIBCPP_BUILDING_LIBRARY) && \
13131314 !defined (_LIBCPP_DISABLE_AVAILABILITY) && \
13141315 __has_feature (attribute_availability_with_strict) && \
1315- __has_feature(attribute_availability_in_templates)
1316+ __has_feature(attribute_availability_in_templates) && \
1317+ __has_extension(pragma_clang_attribute_external_declaration)
13161318# ifdef __APPLE__
13171319# define _LIBCPP_USE_AVAILABILITY_APPLE
13181320# endif
@@ -1355,6 +1357,21 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
13551357# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
13561358 __attribute__ ((availability(macosx,strict,introduced=10.9 ))) \
13571359 __attribute__((availability(ios,strict,introduced=7.0 )))
1360+ # define _LIBCPP_AVAILABILITY_FILESYSTEM \
1361+ __attribute__ ((availability(macosx,strict,unavailable))) \
1362+ __attribute__((availability(ios,strict,unavailable))) \
1363+ __attribute__((availability(tvos,strict,unavailable))) \
1364+ __attribute__((availability(watchos,strict,unavailable)))
1365+ # define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH \
1366+ _Pragma (" clang attribute push(__attribute__((availability(macosx,strict,unavailable))), apply_to=any(function,record))" ) \
1367+ _Pragma(" clang attribute push(__attribute__((availability(ios,strict,unavailable))), apply_to=any(function,record))" ) \
1368+ _Pragma(" clang attribute push(__attribute__((availability(tvos,strict,unavailable))), apply_to=any(function,record))" ) \
1369+ _Pragma(" clang attribute push(__attribute__((availability(watchos,strict,unavailable))), apply_to=any(function,record))" )
1370+ # define _LIBCPP_AVAILABILITY_FILESYSTEM_POP \
1371+ _Pragma (" clang attribute pop" ) \
1372+ _Pragma(" clang attribute pop" ) \
1373+ _Pragma(" clang attribute pop" ) \
1374+ _Pragma(" clang attribute pop" )
13581375#else
13591376# define _LIBCPP_AVAILABILITY_SHARED_MUTEX
13601377# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
@@ -1366,6 +1383,9 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
13661383# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
13671384# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
13681385# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
1386+ # define _LIBCPP_AVAILABILITY_FILESYSTEM
1387+ # define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
1388+ # define _LIBCPP_AVAILABILITY_FILESYSTEM_POP
13691389#endif
13701390
13711391// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
0 commit comments