[libc++] Refactor the configuration macros to being always defined (#112094)

This is a follow-up to #89178. This updates the `<__config_site>`
macros.
This commit is contained in:
Nikolas Klauser 2024-11-06 10:39:19 +01:00 committed by GitHub
parent 5acc4a3dc0
commit c6f3b7bcd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
215 changed files with 1064 additions and 1082 deletions

View File

@ -641,6 +641,8 @@ target_compile_options(cxx-sanitizer-flags INTERFACE ${SANITIZER_FLAGS})
string(FIND "${LLVM_USE_SANITIZER}" "Address" building_with_asan)
if (NOT "${building_with_asan}" STREQUAL "-1")
config_define(ON _LIBCPP_INSTRUMENTED_WITH_ASAN)
else()
config_define(OFF _LIBCPP_INSTRUMENTED_WITH_ASAN)
endif()
# Link system libraries =======================================================
@ -734,26 +736,26 @@ endfunction()
# Configuration file flags =====================================================
config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION)
config_define(${LIBCXX_ABI_NAMESPACE} _LIBCPP_ABI_NAMESPACE)
config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCPP_ABI_FORCE_ITANIUM)
config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCPP_ABI_FORCE_MICROSOFT)
config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCPP_HAS_NO_THREADS)
config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOCK)
config_define_if_not(LIBCXX_HAS_TERMINAL_AVAILABLE _LIBCPP_HAS_NO_TERMINAL)
config_define(${LIBCXX_ABI_FORCE_ITANIUM} _LIBCPP_ABI_FORCE_ITANIUM)
config_define(${LIBCXX_ABI_FORCE_MICROSOFT} _LIBCPP_ABI_FORCE_MICROSOFT)
config_define(${LIBCXX_ENABLE_THREADS} _LIBCPP_HAS_THREADS)
config_define(${LIBCXX_ENABLE_MONOTONIC_CLOCK} _LIBCPP_HAS_MONOTONIC_CLOCK)
config_define(${LIBCXX_HAS_TERMINAL_AVAILABLE} _LIBCPP_HAS_TERMINAL)
if (NOT LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION STREQUAL "default")
config_define("${LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION}" _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION)
endif()
config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD)
config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_EXTERNAL)
config_define_if(LIBCXX_HAS_WIN32_THREAD_API _LIBCPP_HAS_THREAD_API_WIN32)
config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC)
config_define(${LIBCXX_HAS_PTHREAD_API} _LIBCPP_HAS_THREAD_API_PTHREAD)
config_define(${LIBCXX_HAS_EXTERNAL_THREAD_API} _LIBCPP_HAS_THREAD_API_EXTERNAL)
config_define(${LIBCXX_HAS_WIN32_THREAD_API} _LIBCPP_HAS_THREAD_API_WIN32)
config_define(${LIBCXX_HAS_MUSL_LIBC} _LIBCPP_HAS_MUSL_LIBC)
config_define_if(LIBCXX_NO_VCRUNTIME _LIBCPP_NO_VCRUNTIME)
config_define_if_not(LIBCXX_ENABLE_FILESYSTEM _LIBCPP_HAS_NO_FILESYSTEM)
config_define_if_not(LIBCXX_ENABLE_RANDOM_DEVICE _LIBCPP_HAS_NO_RANDOM_DEVICE)
config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION)
config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE)
config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS)
config_define_if_not(LIBCXX_ENABLE_TIME_ZONE_DATABASE _LIBCPP_HAS_NO_TIME_ZONE_DATABASE)
config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
config_define(${LIBCXX_ENABLE_FILESYSTEM} _LIBCPP_HAS_FILESYSTEM)
config_define(${LIBCXX_ENABLE_RANDOM_DEVICE} _LIBCPP_HAS_RANDOM_DEVICE)
config_define(${LIBCXX_ENABLE_LOCALIZATION} _LIBCPP_HAS_LOCALIZATION)
config_define(${LIBCXX_ENABLE_UNICODE} _LIBCPP_HAS_UNICODE)
config_define(${LIBCXX_ENABLE_WIDE_CHARACTERS} _LIBCPP_HAS_WIDE_CHARACTERS)
config_define(${LIBCXX_ENABLE_TIME_ZONE_DATABASE} _LIBCPP_HAS_TIME_ZONE_DATABASE)
config_define(${LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS} _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS)
# TODO: Remove in LLVM 21. We're leaving an error to make this fail explicitly.
if (LIBCXX_ENABLE_ASSERTIONS)

View File

@ -45,9 +45,9 @@ API but leaves out the implementation.
Threading Configuration Macros
==============================
**_LIBCPP_HAS_NO_THREADS**
This macro is defined when libc++ is built without threading support. It
should not be manually defined by the user.
**_LIBCPP_HAS_THREADS**
This macro is set to 1 when libc++ is built with threading support. Otherwise
it is set to 0. It should not be manually defined by the user.
**_LIBCPP_HAS_THREAD_API_EXTERNAL**
This macro is defined when libc++ should use the ``<__external_threading>``

View File

@ -29,7 +29,7 @@
#include <__utility/move.h>
#include <limits>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar>
#endif
@ -65,7 +65,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _T
return __last;
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <class _Tp,
class _Up,
class _Proj,
@ -77,7 +77,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find(_Tp* __first, _T
return __ret;
return __last;
}
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
// TODO: This should also be possible to get right with different signedness
// cast integral types to allow vectorization

View File

@ -26,7 +26,7 @@
#include <__type_traits/is_trivially_lexicographically_comparable.h>
#include <__type_traits/is_volatile.h>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar>
#endif
@ -78,14 +78,14 @@ __lexicographical_compare(_Tp* __first1, _Tp* __last1, _Tp* __first2, _Tp* __las
return __last1 - __first1 < __last2 - __first2;
return __res < 0;
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
else if constexpr (is_same<__remove_cv_t<_Tp>, wchar_t>::value) {
auto __res = std::__constexpr_wmemcmp(__first1, __first2, std::min(__last1 - __first1, __last2 - __first2));
if (__res == 0)
return __last1 - __first1 < __last2 - __first2;
return __res < 0;
}
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
else {
auto __res = std::mismatch(__first1, __last1, __first2, __last2);
if (__res.second == __last2)

View File

@ -851,7 +851,7 @@ template <class _Comp, class _RandomAccessIterator>
void __sort(_RandomAccessIterator, _RandomAccessIterator, _Comp);
extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
#endif
extern template _LIBCPP_EXPORTED_FROM_ABI void
@ -896,7 +896,7 @@ template <class _Type>
using __sort_is_specialized_in_library = __is_any_of<
_Type,
char,
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
wchar_t,
#endif
signed char,

View File

@ -43,7 +43,7 @@ using atomic_char8_t = atomic<char8_t>;
#endif
using atomic_char16_t = atomic<char16_t>;
using atomic_char32_t = atomic<char32_t>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
using atomic_wchar_t = atomic<wchar_t>;
#endif

View File

@ -69,7 +69,7 @@ struct __atomic_wait_poll_impl {
}
};
#ifndef _LIBCPP_HAS_NO_THREADS
#if _LIBCPP_HAS_THREADS
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*) _NOEXCEPT;
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*) _NOEXCEPT;
@ -163,7 +163,7 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI void __atomic_notify_all(const _
std::__cxx_atomic_notify_all(__atomic_waitable_traits<__decay_t<_AtomicWaitable> >::__atomic_contention_address(__a));
}
#else // _LIBCPP_HAS_NO_THREADS
#else // _LIBCPP_HAS_THREADS
template <class _AtomicWaitable, class _Poll>
_LIBCPP_HIDE_FROM_ABI void __atomic_wait_unless(const _AtomicWaitable& __a, _Poll&& __poll, memory_order __order) {
@ -177,7 +177,7 @@ _LIBCPP_HIDE_FROM_ABI void __atomic_notify_one(const _AtomicWaitable&) {}
template <class _AtomicWaitable>
_LIBCPP_HIDE_FROM_ABI void __atomic_notify_all(const _AtomicWaitable&) {}
#endif // _LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_HAS_THREADS
template <typename _Tp>
_LIBCPP_HIDE_FROM_ABI bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) {

View File

@ -25,7 +25,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
#if _LIBCPP_HAS_GCC_ATOMIC_IMP
// [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because
// the default operator= in an object is not volatile, a byte-by-byte copy
@ -260,7 +260,7 @@ __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern, memory_o
# define __cxx_atomic_is_lock_free(__s) __atomic_is_lock_free(__s, 0)
#elif defined(_LIBCPP_HAS_C_ATOMIC_IMP)
#elif _LIBCPP_HAS_C_ATOMIC_IMP
template <typename _Tp>
struct __cxx_atomic_base_impl {

View File

@ -180,8 +180,7 @@ _LIBCPP_HIDE_FROM_ABI _Tm __convert_to_tm(const _ChronoT& __value) {
// Has no time information.
} else if constexpr (same_as<_ChronoT, chrono::local_info>) {
// Has no time information.
# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
!defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
} else if constexpr (__is_specialization_v<_ChronoT, chrono::zoned_time>) {
return std::__convert_to_tm<_Tm>(
chrono::sys_time<typename _ChronoT::duration>{__value.get_local_time().time_since_epoch()});

View File

@ -12,7 +12,7 @@
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION
# include <__algorithm/ranges_copy.h>
# include <__chrono/calendar.h>
@ -143,8 +143,7 @@ __format_sub_seconds(basic_stringstream<_CharT>& __sstr, const chrono::hh_mm_ss<
__value.fractional_width);
}
# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && \
!defined(_LIBCPP_HAS_NO_FILESYSTEM)
# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
template <class _CharT, class _Duration, class _TimeZonePtr>
_LIBCPP_HIDE_FROM_ABI void
__format_sub_seconds(basic_stringstream<_CharT>& __sstr, const chrono::zoned_time<_Duration, _TimeZonePtr>& __value) {
@ -156,8 +155,7 @@ template <class _Tp>
consteval bool __use_fraction() {
if constexpr (__is_time_point<_Tp>)
return chrono::hh_mm_ss<typename _Tp::duration>::fractional_width;
# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && \
!defined(_LIBCPP_HAS_NO_FILESYSTEM)
# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB) && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
else if constexpr (__is_specialization_v<_Tp, chrono::zoned_time>)
return chrono::hh_mm_ss<typename _Tp::duration>::fractional_width;
# endif
@ -232,7 +230,7 @@ _LIBCPP_HIDE_FROM_ABI __time_zone __convert_to_time_zone([[maybe_unused]] const
# if !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB)
if constexpr (same_as<_Tp, chrono::sys_info>)
return {__value.abbrev, __value.offset};
# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
else if constexpr (__is_specialization_v<_Tp, chrono::zoned_time>)
return __formatter::__convert_to_time_zone(__value.get_info());
# endif
@ -450,7 +448,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_ok(const _Tp& __value) {
return true;
else if constexpr (same_as<_Tp, chrono::local_info>)
return true;
# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
else if constexpr (__is_specialization_v<_Tp, chrono::zoned_time>)
return true;
# endif
@ -500,7 +498,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_name_ok(const _Tp& __value) {
return true;
else if constexpr (same_as<_Tp, chrono::local_info>)
return true;
# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
else if constexpr (__is_specialization_v<_Tp, chrono::zoned_time>)
return true;
# endif
@ -550,7 +548,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __date_ok(const _Tp& __value) {
return true;
else if constexpr (same_as<_Tp, chrono::local_info>)
return true;
# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
else if constexpr (__is_specialization_v<_Tp, chrono::zoned_time>)
return true;
# endif
@ -600,7 +598,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __month_name_ok(const _Tp& __value) {
return true;
else if constexpr (same_as<_Tp, chrono::local_info>)
return true;
# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
else if constexpr (__is_specialization_v<_Tp, chrono::zoned_time>)
return true;
# endif
@ -964,7 +962,7 @@ public:
return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags{});
}
};
# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
// Note due to how libc++'s formatters are implemented there is no need to add
// the exposition only local-time-format-t abstraction.
template <class _Duration, class _TimeZonePtr, __fmt_char_type _CharT>
@ -977,13 +975,13 @@ public:
return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__clock);
}
};
# endif // !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
# endif // _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
# endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_TZDB)
# endif // if _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD
#endif // !_LIBCPP_HAS_NO_LOCALIZATION
#endif // _LIBCPP_HAS_LOCALIZATION
#endif // _LIBCPP___CHRONO_FORMATTER_H

View File

@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace chrono {
#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
#if _LIBCPP_HAS_MONOTONIC_CLOCK
typedef steady_clock high_resolution_clock;
#else
typedef system_clock high_resolution_clock;

View File

@ -12,7 +12,7 @@
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION
# include <__chrono/calendar.h>
# include <__chrono/day.h>
@ -86,7 +86,7 @@ _LIBCPP_HIDE_FROM_ABI auto __units_suffix() {
else if constexpr (same_as<typename _Period::type, nano>)
return _LIBCPP_STATICALLY_WIDEN(_CharT, "ns");
else if constexpr (same_as<typename _Period::type, micro>)
# ifndef _LIBCPP_HAS_NO_UNICODE
# if _LIBCPP_HAS_UNICODE
return _LIBCPP_STATICALLY_WIDEN(_CharT, "\u00b5s");
# else
return _LIBCPP_STATICALLY_WIDEN(_CharT, "us");
@ -307,7 +307,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const local_info& __info) {
_LIBCPP_STATICALLY_WIDEN(_CharT, "{}: {{{}, {}}}"), __result(), __info.first, __info.second);
}
# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
template <class _CharT, class _Traits, class _Duration, class _TimeZonePtr>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const zoned_time<_Duration, _TimeZonePtr>& __tp) {
@ -322,6 +322,6 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const zoned_time<_Duration, _Ti
_LIBCPP_END_NAMESPACE_STD
#endif // !_LIBCPP_HAS_NO_LOCALIZATION
#endif // _LIBCPP_HAS_LOCALIZATION
#endif // _LIBCPP___CHRONO_OSTREAM_H

View File

@ -12,7 +12,7 @@
#include <__config>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
# include <__format/concepts.h>
# include <__format/format_error.h>
@ -416,6 +416,6 @@ private:
_LIBCPP_END_NAMESPACE_STD
#endif // !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#endif // _LIBCPP_HAS_LOCALIZATION
#endif // _LIBCPP___CHRONO_PARSER_STD_FORMAT_SPEC_H

View File

@ -24,7 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 20
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <__fmt_char_type _CharT>
_LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __statically_widen(const char* __str, const wchar_t* __wstr) {
if constexpr (same_as<_CharT, char>)
@ -33,7 +33,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __statically_widen(const char* __s
return __wstr;
}
# define _LIBCPP_STATICALLY_WIDEN(_CharT, __str) ::std::__statically_widen<_CharT>(__str, L##__str)
# else // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# else // _LIBCPP_HAS_WIDE_CHARACTERS
// Without this indirection the unit test test/libcxx/modules_include.sh.cpp
// fails for the CI build "No wide characters". This seems like a bug.
@ -43,7 +43,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* __statically_widen(const char* __s
return __str;
}
# define _LIBCPP_STATICALLY_WIDEN(_CharT, __str) ::std::__statically_widen<_CharT>(__str)
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
#endif // _LIBCPP_STD_VER >= 20

View File

@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace chrono {
#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
#if _LIBCPP_HAS_MONOTONIC_CLOCK
class _LIBCPP_EXPORTED_FROM_ABI steady_clock {
public:
typedef nanoseconds duration;

View File

@ -37,8 +37,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
!defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
namespace chrono {
@ -170,8 +169,8 @@ operator<=>(const time_zone& __x, const time_zone& __y) noexcept {
} // namespace chrono
# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
// && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
// _LIBCPP_HAS_LOCALIZATION
_LIBCPP_END_NAMESPACE_STD

View File

@ -31,8 +31,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
!defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
namespace chrono {
@ -68,7 +67,8 @@ operator<=>(const time_zone_link& __x, const time_zone_link& __y) noexcept {
} // namespace chrono
# endif // _LIBCPP_STD_VER >= 20
# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
// _LIBCPP_HAS_LOCALIZATION
_LIBCPP_END_NAMESPACE_STD

View File

@ -36,8 +36,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
!defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
namespace chrono {
@ -85,8 +84,8 @@ private:
} // namespace chrono
# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
// && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
// _LIBCPP_HAS_LOCALIZATION
_LIBCPP_END_NAMESPACE_STD

View File

@ -29,8 +29,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
!defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
namespace chrono {
@ -99,8 +98,8 @@ _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI const tzdb& reload_tzdb();
} // namespace chrono
# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
// && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
// _LIBCPP_HAS_LOCALIZATION
_LIBCPP_END_NAMESPACE_STD

View File

@ -40,8 +40,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
!defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
namespace chrono {
@ -217,8 +216,8 @@ operator==(const zoned_time<_Duration1, _TimeZonePtr>& __lhs, const zoned_time<_
} // namespace chrono
# endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
// && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&
// _LIBCPP_HAS_LOCALIZATION
_LIBCPP_END_NAMESPACE_STD

View File

@ -33,7 +33,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_THREADS
#if _LIBCPP_HAS_THREADS
// enum class cv_status
_LIBCPP_DECLARE_STRONG_ENUM(cv_status){no_timeout, timeout};
@ -91,7 +91,7 @@ private:
_LIBCPP_HIDE_FROM_ABI void
__do_timed_wait(unique_lock<mutex>& __lk, chrono::time_point<_Clock, chrono::nanoseconds>) _NOEXCEPT;
};
#endif // !_LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_HAS_THREADS
template <class _Rep, class _Period, __enable_if_t<is_floating_point<_Rep>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI chrono::nanoseconds __safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d) {
@ -140,7 +140,7 @@ inline _LIBCPP_HIDE_FROM_ABI chrono::nanoseconds __safe_nanosecond_cast(chrono::
return nanoseconds(__result);
}
#ifndef _LIBCPP_HAS_NO_THREADS
#if _LIBCPP_HAS_THREADS
template <class _Predicate>
void condition_variable::wait(unique_lock<mutex>& __lk, _Predicate __pred) {
while (!__pred())
@ -235,7 +235,7 @@ inline void condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
wait_for(__lk, __tp - _Clock::now());
}
#endif // _LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -806,10 +806,10 @@ typedef __char32_t char32_t;
// Thread API
// clang-format off
# if !defined(_LIBCPP_HAS_NO_THREADS) && \
!defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \
!defined(_LIBCPP_HAS_THREAD_API_WIN32) && \
!defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
# if _LIBCPP_HAS_THREADS && \
!_LIBCPP_HAS_THREAD_API_PTHREAD && \
!_LIBCPP_HAS_THREAD_API_WIN32 && \
!_LIBCPP_HAS_THREAD_API_EXTERNAL
# if defined(__FreeBSD__) || \
defined(__wasi__) || \
@ -823,18 +823,21 @@ typedef __char32_t char32_t;
defined(_AIX) || \
defined(__EMSCRIPTEN__)
// clang-format on
# define _LIBCPP_HAS_THREAD_API_PTHREAD
# undef _LIBCPP_HAS_THREAD_API_PTHREAD
# define _LIBCPP_HAS_THREAD_API_PTHREAD 1
# elif defined(__Fuchsia__)
// TODO(44575): Switch to C11 thread API when possible.
# define _LIBCPP_HAS_THREAD_API_PTHREAD
# undef _LIBCPP_HAS_THREAD_API_PTHREAD
# define _LIBCPP_HAS_THREAD_API_PTHREAD 1
# elif defined(_LIBCPP_WIN32API)
# define _LIBCPP_HAS_THREAD_API_WIN32
# undef _LIBCPP_HAS_THREAD_API_WIN32
# define _LIBCPP_HAS_THREAD_API_WIN32 1
# else
# error "No thread API"
# endif // _LIBCPP_HAS_THREAD_API
# endif // _LIBCPP_HAS_NO_THREADS
# endif // _LIBCPP_HAS_THREADS
# if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
# if _LIBCPP_HAS_THREAD_API_PTHREAD
# if defined(__ANDROID__) && __ANDROID_API__ >= 30
# define _LIBCPP_HAS_COND_CLOCKWAIT 1
# elif defined(_LIBCPP_GLIBC_PREREQ)
@ -850,22 +853,19 @@ typedef __char32_t char32_t;
# define _LIBCPP_HAS_COND_CLOCKWAIT 0
# endif
# if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
# error _LIBCPP_HAS_THREAD_API_PTHREAD may only be defined when \
_LIBCPP_HAS_NO_THREADS is not defined.
# if !_LIBCPP_HAS_THREADS && _LIBCPP_HAS_THREAD_API_PTHREAD
# error _LIBCPP_HAS_THREAD_API_PTHREAD may only be true when _LIBCPP_HAS_THREADS is true.
# endif
# if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
# error _LIBCPP_HAS_THREAD_API_EXTERNAL may not be defined when \
_LIBCPP_HAS_NO_THREADS is defined.
# if !_LIBCPP_HAS_THREADS && _LIBCPP_HAS_THREAD_API_EXTERNAL
# error _LIBCPP_HAS_THREAD_API_EXTERNAL may not be true when _LIBCPP_HAS_THREADS is true.
# endif
# if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS)
# error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \
_LIBCPP_HAS_NO_THREADS is defined.
# if !_LIBCPP_HAS_MONOTONIC_CLOCK && _LIBCPP_HAS_THREADS
# error _LIBCPP_HAS_MONOTONIC_CLOCK may only be false when _LIBCPP_HAS_THREADS is false.
# endif
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(__STDCPP_THREADS__)
# if _LIBCPP_HAS_THREADS && !defined(__STDCPP_THREADS__)
# define __STDCPP_THREADS__ 1
# endif
@ -880,9 +880,9 @@ typedef __char32_t char32_t;
// TODO(EricWF): Enable this optimization on Bionic after speaking to their
// respective stakeholders.
// clang-format off
# if (defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && defined(__GLIBC__)) || \
(defined(_LIBCPP_HAS_THREAD_API_C11) && defined(__Fuchsia__)) || \
defined(_LIBCPP_HAS_THREAD_API_WIN32)
# if (_LIBCPP_HAS_THREAD_API_PTHREAD && defined(__GLIBC__)) || \
(_LIBCPP_HAS_THREAD_API_C11 && defined(__Fuchsia__)) || \
_LIBCPP_HAS_THREAD_API_WIN32
// clang-format on
# define _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION 1
# else
@ -897,25 +897,28 @@ typedef __char32_t char32_t;
//
// TODO(EricWF): This is potentially true for some pthread implementations
// as well.
# if (defined(_LIBCPP_HAS_THREAD_API_C11) && defined(__Fuchsia__)) || defined(_LIBCPP_HAS_THREAD_API_WIN32)
# if (_LIBCPP_HAS_THREAD_API_C11 && defined(__Fuchsia__)) || _LIBCPP_HAS_THREAD_API_WIN32
# define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION 1
# else
# define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION 0
# endif
# if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) || \
defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__) || defined(__LLVM_LIBC__)
_LIBCPP_HAS_MUSL_LIBC || defined(__OpenBSD__) || defined(__LLVM_LIBC__)
# define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
# endif
# if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic)
# define _LIBCPP_HAS_C_ATOMIC_IMP
# define _LIBCPP_HAS_C_ATOMIC_IMP 1
# define _LIBCPP_HAS_GCC_ATOMIC_IMP 0
# define _LIBCPP_HAS_EXTERNAL_ATOMIC_IMP 0
# elif defined(_LIBCPP_COMPILER_GCC)
# define _LIBCPP_HAS_GCC_ATOMIC_IMP
# define _LIBCPP_HAS_C_ATOMIC_IMP 0
# define _LIBCPP_HAS_GCC_ATOMIC_IMP 1
# define _LIBCPP_HAS_EXTERNAL_ATOMIC_IMP 0
# endif
# if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) && \
!defined(_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP)
# if !_LIBCPP_HAS_C_ATOMIC_IMP && !_LIBCPP_HAS_GCC_ATOMIC_IMP && !_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP
# define _LIBCPP_HAS_ATOMIC_HEADER 0
# else
# define _LIBCPP_HAS_ATOMIC_HEADER 1
@ -976,7 +979,7 @@ typedef __char32_t char32_t;
// When wide characters are disabled, it can be useful to have a quick way of
// disabling it without having to resort to #if-#endif, which has a larger
// impact on readability.
# if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
# if !_LIBCPP_HAS_WIDE_CHARACTERS
# define _LIBCPP_IF_WIDE_CHARACTERS(...)
# else
# define _LIBCPP_IF_WIDE_CHARACTERS(...) __VA_ARGS__

View File

@ -11,27 +11,28 @@
#cmakedefine _LIBCPP_ABI_VERSION @_LIBCPP_ABI_VERSION@
#cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@
#cmakedefine _LIBCPP_ABI_FORCE_ITANIUM
#cmakedefine _LIBCPP_ABI_FORCE_MICROSOFT
#cmakedefine _LIBCPP_HAS_NO_THREADS
#cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK
#cmakedefine _LIBCPP_HAS_NO_TERMINAL
#cmakedefine _LIBCPP_HAS_MUSL_LIBC
#cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD
#cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL
#cmakedefine _LIBCPP_HAS_THREAD_API_WIN32
#cmakedefine01 _LIBCPP_ABI_FORCE_ITANIUM
#cmakedefine01 _LIBCPP_ABI_FORCE_MICROSOFT
#cmakedefine01 _LIBCPP_HAS_THREADS
#cmakedefine01 _LIBCPP_HAS_MONOTONIC_CLOCK
#cmakedefine01 _LIBCPP_HAS_TERMINAL
#cmakedefine01 _LIBCPP_HAS_MUSL_LIBC
#cmakedefine01 _LIBCPP_HAS_THREAD_API_PTHREAD
#cmakedefine01 _LIBCPP_HAS_THREAD_API_EXTERNAL
#cmakedefine01 _LIBCPP_HAS_THREAD_API_WIN32
#define _LIBCPP_HAS_THREAD_API_C11 0 // FIXME: Is this guarding dead code?
#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
#cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
#cmakedefine01 _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS
#cmakedefine _LIBCPP_NO_VCRUNTIME
#cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@
#cmakedefine _LIBCPP_HAS_NO_FILESYSTEM
#cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE
#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION
#cmakedefine _LIBCPP_HAS_NO_UNICODE
#cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS
#cmakedefine01 _LIBCPP_HAS_FILESYSTEM
#cmakedefine01 _LIBCPP_HAS_RANDOM_DEVICE
#cmakedefine01 _LIBCPP_HAS_LOCALIZATION
#cmakedefine01 _LIBCPP_HAS_UNICODE
#cmakedefine01 _LIBCPP_HAS_WIDE_CHARACTERS
#cmakedefine _LIBCPP_HAS_NO_STD_MODULES
#cmakedefine _LIBCPP_HAS_NO_TIME_ZONE_DATABASE
#cmakedefine _LIBCPP_INSTRUMENTED_WITH_ASAN
#cmakedefine01 _LIBCPP_HAS_TIME_ZONE_DATABASE
#cmakedefine01 _LIBCPP_INSTRUMENTED_WITH_ASAN
// PSTL backends
#cmakedefine _LIBCPP_PSTL_BACKEND_SERIAL

View File

@ -23,11 +23,11 @@
// that Windows compilers pretending to be MSVC++ target the Microsoft ABI,
// and allow the user to explicitly specify the ABI to handle cases where this
// heuristic falls short.
#if defined(_LIBCPP_ABI_FORCE_ITANIUM) && defined(_LIBCPP_ABI_FORCE_MICROSOFT)
# error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined"
#elif defined(_LIBCPP_ABI_FORCE_ITANIUM)
#if _LIBCPP_ABI_FORCE_ITANIUM && _LIBCPP_ABI_FORCE_MICROSOFT
# error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be true"
#elif _LIBCPP_ABI_FORCE_ITANIUM
# define _LIBCPP_ABI_ITANIUM
#elif defined(_LIBCPP_ABI_FORCE_MICROSOFT)
#elif _LIBCPP_ABI_FORCE_MICROSOFT
# define _LIBCPP_ABI_MICROSOFT
#else
# if defined(_WIN32) && defined(_MSC_VER)

View File

@ -70,22 +70,20 @@
// For backwards compatibility, allow users to define _LIBCPP_DISABLE_AVAILABILITY
// for a while.
#if defined(_LIBCPP_DISABLE_AVAILABILITY)
# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
# endif
# undef _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS
# define _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS 0
#endif
// Availability markup is disabled when building the library, or when a non-Clang
// compiler is used because only Clang supports the necessary attributes.
#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCXXABI_BUILDING_LIBRARY) || !defined(_LIBCPP_COMPILER_CLANG_BASED)
# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
# endif
# undef _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS
# define _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS 0
#endif
// When availability annotations are disabled, we take for granted that features introduced
// in all versions of the library are available.
#if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
#if !_LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS
# define _LIBCPP_INTRODUCED_IN_LLVM_20 1
# define _LIBCPP_INTRODUCED_IN_LLVM_20_ATTRIBUTE /* nothing */

View File

@ -34,7 +34,7 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
@ -469,7 +469,7 @@ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
_LIBCPP_POP_MACROS

View File

@ -30,7 +30,7 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
@ -143,7 +143,7 @@ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY inline constexpr bool
# endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
_LIBCPP_POP_MACROS

View File

@ -27,7 +27,7 @@
# pragma GCC system_header
#endif
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
@ -305,6 +305,6 @@ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
_LIBCPP_END_NAMESPACE_FILESYSTEM
#endif // _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
#endif // _LIBCPP___FILESYSTEM_OPERATIONS_H

View File

@ -25,7 +25,7 @@
#include <string>
#include <string_view>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
# include <iomanip> // for quoted
# include <locale>
#endif
@ -199,7 +199,7 @@ _LIBCPP_EXPORTED_FROM_ABI size_t __char_to_wide(const string&, wchar_t*, size_t)
template <class _ECharT>
struct _PathCVT;
# if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_HAS_LOCALIZATION
template <class _ECharT>
struct _PathCVT {
static_assert(__can_convert_char<_ECharT>::value, "Char type not convertible");
@ -258,7 +258,7 @@ struct _PathCVT {
__append_range(__dest, _Traits::__range_begin(__s), _Traits::__range_end(__s));
}
};
# endif // !_LIBCPP_HAS_NO_LOCALIZATION
# endif // _LIBCPP_HAS_LOCALIZATION
template <>
struct _PathCVT<__path_value> {
@ -420,7 +420,7 @@ public:
}
/*
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
// TODO Implement locale conversions.
template <class _Source, class = _EnableIfPathable<_Source, void> >
path(const _Source& __src, const locale& __loc, format = format::auto_format);
@ -682,7 +682,7 @@ public:
return __s;
}
# if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_HAS_LOCALIZATION
template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >
_LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator> string(const _Allocator& __a = _Allocator()) const {
using _Str = basic_string<_ECharT, _Traits, _Allocator>;
@ -725,7 +725,7 @@ public:
std::replace(__s.begin(), __s.end(), '\\', '/');
return __s;
}
# endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
# endif // _LIBCPP_HAS_LOCALIZATION
# else /* _LIBCPP_WIN32API */
_LIBCPP_HIDE_FROM_ABI std::string string() const { return __pn_; }
@ -735,7 +735,7 @@ public:
_LIBCPP_HIDE_FROM_ABI std::string u8string() const { return __pn_; }
# endif
# if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_HAS_LOCALIZATION
template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >
_LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator> string(const _Allocator& __a = _Allocator()) const {
using _CVT = __widen_from_utf8<sizeof(_ECharT) * __CHAR_BIT__>;
@ -746,12 +746,12 @@ public:
return __s;
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_HIDE_FROM_ABI std::wstring wstring() const { return string<wchar_t>(); }
# endif
_LIBCPP_HIDE_FROM_ABI std::u16string u16string() const { return string<char16_t>(); }
_LIBCPP_HIDE_FROM_ABI std::u32string u32string() const { return string<char32_t>(); }
# endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
# endif // _LIBCPP_HAS_LOCALIZATION
// generic format observers
_LIBCPP_HIDE_FROM_ABI std::string generic_string() const { return __pn_; }
@ -761,19 +761,19 @@ public:
_LIBCPP_HIDE_FROM_ABI std::string generic_u8string() const { return __pn_; }
# endif
# if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_HAS_LOCALIZATION
template <class _ECharT, class _Traits = char_traits<_ECharT>, class _Allocator = allocator<_ECharT> >
_LIBCPP_HIDE_FROM_ABI basic_string<_ECharT, _Traits, _Allocator>
generic_string(const _Allocator& __a = _Allocator()) const {
return string<_ECharT, _Traits, _Allocator>(__a);
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_HIDE_FROM_ABI std::wstring generic_wstring() const { return string<wchar_t>(); }
# endif
_LIBCPP_HIDE_FROM_ABI std::u16string generic_u16string() const { return string<char16_t>(); }
_LIBCPP_HIDE_FROM_ABI std::u32string generic_u32string() const { return string<char32_t>(); }
# endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
# endif // _LIBCPP_HAS_LOCALIZATION
# endif /* !_LIBCPP_WIN32API */
private:
@ -866,7 +866,7 @@ public:
iterator begin() const;
iterator end() const;
# if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_HAS_LOCALIZATION
template <
class _CharT,
class _Traits,
@ -895,7 +895,7 @@ public:
__p = __tmp;
return __is;
}
# endif // !_LIBCPP_HAS_NO_LOCALIZATION
# endif // _LIBCPP_HAS_LOCALIZATION
private:
inline _LIBCPP_HIDE_FROM_ABI path& __assign_view(__string_view const& __s) {

View File

@ -29,7 +29,7 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
@ -156,7 +156,7 @@ _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY inline constexpr bool
# endif // _LIBCPP_STD_VER >= 20
#endif // _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
#endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
_LIBCPP_POP_MACROS

View File

@ -34,7 +34,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT>
concept __fmt_char_type =
same_as<_CharT, char>
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
|| same_as<_CharT, wchar_t>
# endif
;

View File

@ -49,7 +49,7 @@ template <class _Context, same_as<typename _Context::char_type> _Tp>
consteval __arg_t __determine_arg_t() {
return __arg_t::__char_type;
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <class _Context, class _CharT>
requires(same_as<typename _Context::char_type, wchar_t> && same_as<_CharT, char>)
consteval __arg_t __determine_arg_t() {
@ -173,7 +173,7 @@ _LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp& __valu
// final else requires no adjustment.
if constexpr (__arg == __arg_t::__char_type)
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
if constexpr (same_as<typename _Context::char_type, wchar_t> && same_as<_Dp, char>)
return basic_format_arg<_Context>{__arg, static_cast<wchar_t>(static_cast<unsigned char>(__value))};
else

View File

@ -24,7 +24,7 @@
#include <__utility/move.h>
#include <__variant/monostate.h>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION
# include <__locale>
# include <optional>
#endif
@ -44,7 +44,7 @@ template <class _OutIt, class _CharT>
requires output_iterator<_OutIt, const _CharT&>
class _LIBCPP_TEMPLATE_VIS basic_format_context;
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
/**
* Helper to create a basic_format_context.
*
@ -66,7 +66,7 @@ __format_context_create(_OutIt __out_it, basic_format_args<basic_format_context<
# endif
using format_context = basic_format_context<back_insert_iterator<__format::__output_buffer<char>>, char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
using wformat_context = basic_format_context< back_insert_iterator<__format::__output_buffer<wchar_t>>, wchar_t>;
# endif
@ -88,7 +88,7 @@ public:
_LIBCPP_HIDE_FROM_ABI basic_format_arg<basic_format_context> arg(size_t __id) const noexcept {
return __args_.get(__id);
}
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
_LIBCPP_HIDE_FROM_ABI std::locale locale() {
if (!__loc_)
__loc_ = std::locale{};
@ -101,7 +101,7 @@ public:
private:
iterator __out_it_;
basic_format_args<basic_format_context> __args_;
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
// The Standard doesn't specify how the locale is stored.
// [format.context]/6
@ -163,7 +163,7 @@ public:
template <class _Context>
_LIBCPP_HIDE_FROM_ABI explicit basic_format_context(iterator __out_it, _Context& __ctx)
: __out_it_(std::move(__out_it)),
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
__loc_([](void* __c) { return static_cast<_Context*>(__c)->locale(); }),
# endif
__ctx_(std::addressof(__ctx)),
@ -193,7 +193,7 @@ public:
_LIBCPP_HIDE_FROM_ABI basic_format_arg<basic_format_context> arg(size_t __id) const noexcept {
return __arg_(__ctx_, __id);
}
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
_LIBCPP_HIDE_FROM_ABI std::locale locale() { return __loc_(__ctx_); }
# endif
_LIBCPP_HIDE_FROM_ABI iterator out() { return std::move(__out_it_); }
@ -202,7 +202,7 @@ public:
private:
iterator __out_it_;
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
std::locale (*__loc_)(void* __ctx);
# endif

View File

@ -40,7 +40,7 @@
#include <string>
#include <string_view>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION
# include <__locale>
#endif
@ -61,7 +61,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// to do this optimization now.
using format_args = basic_format_args<format_context>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
using wformat_args = basic_format_args<wformat_context>;
# endif
@ -70,7 +70,7 @@ template <class _Context = format_context, class... _Args>
return std::__format_arg_store<_Context, _Args...>(__args...);
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <class... _Args>
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...> make_wformat_args(_Args&... __args) {
return std::__format_arg_store<wformat_context, _Args...>(__args...);
@ -355,7 +355,7 @@ public:
};
_LIBCPP_HIDE_FROM_ABI inline __runtime_format_string<char> runtime_format(string_view __fmt) noexcept { return __fmt; }
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_HIDE_FROM_ABI inline __runtime_format_string<wchar_t> runtime_format(wstring_view __fmt) noexcept {
return __fmt;
}
@ -397,7 +397,7 @@ private:
template <class... _Args>
using format_string = basic_format_string<char, type_identity_t<_Args>...>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <class... _Args>
using wformat_string = basic_format_string<wchar_t, type_identity_t<_Args>...>;
# endif
@ -426,7 +426,7 @@ _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt vformat_to(_OutIt __out_it, s
return std::__vformat_to(std::move(__out_it), __fmt, __args);
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
vformat_to(_OutIt __out_it, wstring_view __fmt, wformat_args __args) {
@ -440,7 +440,7 @@ format_to(_OutIt __out_it, format_string<_Args...> __fmt, _Args&&... __args) {
return std::vformat_to(std::move(__out_it), __fmt.get(), std::make_format_args(__args...));
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, wformat_string<_Args...> __fmt, _Args&&... __args) {
@ -457,7 +457,7 @@ template <class = void>
return __res;
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
// fires too eagerly, see http://llvm.org/PR61563.
template <class = void>
@ -475,7 +475,7 @@ format(format_string<_Args...> __fmt, _Args&&... __args) {
return std::vformat(__fmt.get(), std::make_format_args(__args...));
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <class... _Args>
[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring
format(wformat_string<_Args...> __fmt, _Args&&... __args) {
@ -501,7 +501,7 @@ format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, format_string<_Args.
return std::__vformat_to_n<format_context>(std::move(__out_it), __n, __fmt.get(), std::make_format_args(__args...));
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, wformat_string<_Args...> __fmt, _Args&&... __args) {
@ -523,7 +523,7 @@ formatted_size(format_string<_Args...> __fmt, _Args&&... __args) {
return std::__vformatted_size(__fmt.get(), basic_format_args{std::make_format_args(__args...)});
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <class... _Args>
[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(wformat_string<_Args...> __fmt, _Args&&... __args) {
@ -531,7 +531,7 @@ formatted_size(wformat_string<_Args...> __fmt, _Args&&... __args) {
}
# endif
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
template <class _OutIt, class _CharT, class _FormatOutIt>
requires(output_iterator<_OutIt, const _CharT&>)
@ -558,7 +558,7 @@ vformat_to(_OutIt __out_it, locale __loc, string_view __fmt, format_args __args)
return std::__vformat_to(std::move(__out_it), std::move(__loc), __fmt, __args);
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
vformat_to(_OutIt __out_it, locale __loc, wstring_view __fmt, wformat_args __args) {
@ -572,7 +572,7 @@ format_to(_OutIt __out_it, locale __loc, format_string<_Args...> __fmt, _Args&&.
return std::vformat_to(std::move(__out_it), std::move(__loc), __fmt.get(), std::make_format_args(__args...));
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
@ -590,7 +590,7 @@ vformat(locale __loc, string_view __fmt, format_args __args) {
return __res;
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup
// fires too eagerly, see http://llvm.org/PR61563.
template <class = void>
@ -608,7 +608,7 @@ format(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
return std::vformat(std::move(__loc), __fmt.get(), std::make_format_args(__args...));
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <class... _Args>
[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring
format(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
@ -637,7 +637,7 @@ _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> format_to
std::move(__out_it), __n, std::move(__loc), __fmt.get(), std::make_format_args(__args...));
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> format_to_n(
_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
@ -661,7 +661,7 @@ formatted_size(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
return std::__vformatted_size(std::move(__loc), __fmt.get(), basic_format_args{std::make_format_args(__args...)});
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <class... _Args>
[[nodiscard]] _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
@ -669,7 +669,7 @@ formatted_size(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args)
}
# endif
# endif // _LIBCPP_HAS_NO_LOCALIZATION
# endif // _LIBCPP_HAS_LOCALIZATION
#endif // _LIBCPP_STD_VER >= 20

View File

@ -94,7 +94,7 @@ private:
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(basic_format_parse_context);
using format_parse_context = basic_format_parse_context<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
using wformat_parse_context = basic_format_parse_context<wchar_t>;
# endif

View File

@ -20,7 +20,7 @@
#include <__format/parser_std_format_spec.h>
#include <__utility/unreachable.h>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION
# include <__locale>
#endif

View File

@ -77,21 +77,21 @@ public:
template <>
struct _LIBCPP_TEMPLATE_VIS formatter<char, char> : public __formatter_char<char> {};
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
struct _LIBCPP_TEMPLATE_VIS formatter<char, wchar_t> : public __formatter_char<wchar_t> {};
template <>
struct _LIBCPP_TEMPLATE_VIS formatter<wchar_t, wchar_t> : public __formatter_char<wchar_t> {};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_STD_VER >= 23
template <>
inline constexpr bool enable_nonlocking_formatter_optimization<char> = true;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
inline constexpr bool enable_nonlocking_formatter_optimization<wchar_t> = true;
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# endif // _LIBCPP_STD_VER >= 23
#endif // _LIBCPP_STD_VER >= 20

View File

@ -38,7 +38,7 @@
#include <__utility/unreachable.h>
#include <cmath>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION
# include <__locale>
#endif
@ -491,7 +491,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer(
}
}
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
template <class _OutIt, class _Fp, class _CharT>
_LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
_OutIt __out_it,
@ -576,7 +576,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
// alignment
return __formatter::__fill(std::move(__out_it), __padding.__after_, __specs.__fill_);
}
# endif // _LIBCPP_HAS_NO_LOCALIZATION
# endif // _LIBCPP_HAS_LOCALIZATION
template <class _OutIt, class _CharT>
_LIBCPP_HIDE_FROM_ABI _OutIt __format_floating_point_non_finite(
@ -705,7 +705,7 @@ __format_floating_point(_Tp __value, _FormatContext& __ctx, __format_spec::__par
}
}
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
if (__specs.__std_.__locale_specific_form_)
return __formatter::__format_locale_specific_form(__ctx.out(), __buffer, __result, __ctx.locale(), __specs);
# endif

View File

@ -32,7 +32,7 @@
#include <string>
#include <string_view>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION
# include <__locale>
#endif
@ -298,7 +298,7 @@ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator __format_integer(
_Iterator __last = __formatter::__to_buffer(__first, __end, __value, __base);
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
if (__specs.__std_.__locale_specific_form_) {
const auto& __np = std::use_facet<numpunct<_CharT>>(__ctx.locale());
string __grouping = __np.grouping();
@ -412,7 +412,7 @@ struct _LIBCPP_TEMPLATE_VIS __bool_strings<char> {
static constexpr string_view __false{"false"};
};
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
struct _LIBCPP_TEMPLATE_VIS __bool_strings<wchar_t> {
static constexpr wstring_view __true{L"true"};
@ -423,7 +423,7 @@ struct _LIBCPP_TEMPLATE_VIS __bool_strings<wchar_t> {
template <class _CharT, class _FormatContext>
_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
__format_bool(bool __value, _FormatContext& __ctx, __format_spec::__parsed_specifications<_CharT> __specs) {
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
if (__specs.__std_.__locale_specific_form_) {
const auto& __np = std::use_facet<numpunct<_CharT>>(__ctx.locale());
basic_string<_CharT> __str = __value ? __np.truename() : __np.falsename();

View File

@ -169,7 +169,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, _CharT __value)
}
}
# ifndef _LIBCPP_HAS_NO_UNICODE
# if _LIBCPP_HAS_UNICODE
template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
requires(same_as<_CharT, char>)
_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
@ -183,7 +183,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::
return __out_it;
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
requires(same_as<_CharT, wchar_t> && sizeof(wchar_t) == 2)
_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
@ -201,13 +201,13 @@ template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
}
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# else // _LIBCPP_HAS_NO_UNICODE
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# else // _LIBCPP_HAS_UNICODE
template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, __format_spec::__code_point<_CharT> __value) {
return __formatter::__fill(std::move(__out_it), __n, __value.__data[0]);
}
# endif // _LIBCPP_HAS_NO_UNICODE
# endif // _LIBCPP_HAS_UNICODE
/// Writes the input to the output with the required padding.
///
@ -295,8 +295,7 @@ _LIBCPP_HIDE_FROM_ABI auto __write_transformed(
///
/// \pre !__specs.__has_precision()
///
/// \note When \c _LIBCPP_HAS_NO_UNICODE is defined the function assumes the
/// input is ASCII.
/// \note When \c _LIBCPP_HAS_UNICODE is false the function assumes the input is ASCII.
template <class _CharT>
_LIBCPP_HIDE_FROM_ABI auto __write_string_no_precision(
basic_string_view<_CharT> __str,

View File

@ -137,7 +137,7 @@ inline constexpr bool enable_nonlocking_formatter_optimization<basic_string<char
template <class _Traits>
inline constexpr bool enable_nonlocking_formatter_optimization<basic_string_view<char, _Traits>> = true;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
inline constexpr bool enable_nonlocking_formatter_optimization<wchar_t*> = true;
template <>
@ -148,7 +148,7 @@ template <class _Traits, class _Allocator>
inline constexpr bool enable_nonlocking_formatter_optimization<basic_string<wchar_t, _Traits, _Allocator>> = true;
template <class _Traits>
inline constexpr bool enable_nonlocking_formatter_optimization<basic_string_view<wchar_t, _Traits>> = true;
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# endif // _LIBCPP_STD_VER >= 23
#endif // _LIBCPP_STD_VER >= 20

View File

@ -268,7 +268,7 @@ struct __code_point<char> {
char __data[4] = {' '};
};
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
struct __code_point<wchar_t> {
wchar_t __data[4 / sizeof(wchar_t)] = {L' '};
@ -321,7 +321,7 @@ struct __parsed_specifications {
// value in formatting functions.
static_assert(sizeof(__parsed_specifications<char>) == 16);
static_assert(is_trivially_copyable_v<__parsed_specifications<char>>);
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
static_assert(sizeof(__parsed_specifications<wchar_t>) == 16);
static_assert(is_trivially_copyable_v<__parsed_specifications<wchar_t>>);
# endif
@ -580,11 +580,11 @@ private:
std::__throw_format_error("The fill option contains an invalid value");
}
# ifndef _LIBCPP_HAS_NO_UNICODE
# if _LIBCPP_HAS_UNICODE
// range-fill and tuple-fill are identical
template <contiguous_iterator _Iterator>
requires same_as<_CharT, char>
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
|| (same_as<_CharT, wchar_t> && sizeof(wchar_t) == 2)
# endif
_LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end) {
@ -617,7 +617,7 @@ private:
return true;
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <contiguous_iterator _Iterator>
requires(same_as<_CharT, wchar_t> && sizeof(wchar_t) == 4)
_LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end) {
@ -643,9 +643,9 @@ private:
return true;
}
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# else // _LIBCPP_HAS_NO_UNICODE
# else // _LIBCPP_HAS_UNICODE
// range-fill and tuple-fill are identical
template <contiguous_iterator _Iterator>
_LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end) {
@ -670,7 +670,7 @@ private:
return true;
}
# endif // _LIBCPP_HAS_NO_UNICODE
# endif // _LIBCPP_HAS_UNICODE
template <contiguous_iterator _Iterator>
_LIBCPP_HIDE_FROM_ABI constexpr bool __parse_sign(_Iterator& __begin) {
@ -874,7 +874,7 @@ private:
// Validates whether the reserved bitfields don't change the size.
static_assert(sizeof(__parser<char>) == 16);
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
static_assert(sizeof(__parser<wchar_t>) == 16);
# endif
@ -1026,7 +1026,7 @@ __column_width_result(size_t, _Iterator) -> __column_width_result<_Iterator>;
/// "rounded up".
enum class __column_width_rounding { __down, __up };
# ifndef _LIBCPP_HAS_NO_UNICODE
# if _LIBCPP_HAS_UNICODE
namespace __detail {
template <contiguous_iterator _Iterator>
@ -1148,7 +1148,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_Iterator> __estimate_colu
__result.__width_ += __ascii_size;
return __result;
}
# else // !defined(_LIBCPP_HAS_NO_UNICODE)
# else // _LIBCPP_HAS_UNICODE
template <class _CharT>
_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<typename basic_string_view<_CharT>::const_iterator>
__estimate_column_width(basic_string_view<_CharT> __str, size_t __maximum, __column_width_rounding) noexcept {
@ -1159,7 +1159,7 @@ __estimate_column_width(basic_string_view<_CharT> __str, size_t __maximum, __col
return {__width, __str.begin() + __width};
}
# endif // !defined(_LIBCPP_HAS_NO_UNICODE)
# endif // _LIBCPP_HAS_UNICODE
} // namespace __format_spec

View File

@ -54,7 +54,7 @@ struct __consume_result {
};
static_assert(sizeof(__consume_result) == sizeof(char32_t));
# ifndef _LIBCPP_HAS_NO_UNICODE
# if _LIBCPP_HAS_UNICODE
/// Implements the grapheme cluster boundary rules
///
@ -235,7 +235,7 @@ private:
_Iterator __last_;
};
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_HIDE_FROM_ABI constexpr bool __is_surrogate_pair_high(wchar_t __value) {
return __value >= 0xd800 && __value <= 0xdbff;
}
@ -292,7 +292,7 @@ private:
_Iterator __first_;
_Iterator __last_;
};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
// State machine to implement the Extended Grapheme Cluster Boundary
//
@ -566,10 +566,10 @@ private:
template <contiguous_iterator _Iterator>
__extended_grapheme_cluster_view(_Iterator, _Iterator) -> __extended_grapheme_cluster_view<iter_value_t<_Iterator>>;
# else // _LIBCPP_HAS_NO_UNICODE
# else // _LIBCPP_HAS_UNICODE
// For ASCII every character is a "code point".
// This makes it easier to write code agnostic of the _LIBCPP_HAS_NO_UNICODE define.
// This makes it easier to write code agnostic of the _LIBCPP_HAS_UNICODE define.
template <class _CharT>
class __code_point_view {
using _Iterator = typename basic_string_view<_CharT>::const_iterator;
@ -591,7 +591,7 @@ private:
_Iterator __last_;
};
# endif // _LIBCPP_HAS_NO_UNICODE
# endif // _LIBCPP_HAS_UNICODE
} // namespace __unicode

View File

@ -42,8 +42,7 @@ namespace __formatter {
/// Writes a string using format's width estimation algorithm.
///
/// \note When \c _LIBCPP_HAS_NO_UNICODE is defined the function assumes the
/// input is ASCII.
/// \note When \c _LIBCPP_HAS_UNICODE is false the function assumes the input is ASCII.
template <class _CharT>
_LIBCPP_HIDE_FROM_ABI auto
__write_string(basic_string_view<_CharT> __str,
@ -104,7 +103,7 @@ _LIBCPP_HIDE_FROM_ABI void __write_escape_ill_formed_code_unit(basic_string<_Cha
template <class _CharT>
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool
__is_escaped_sequence_written(basic_string<_CharT>& __str, bool __last_escaped, char32_t __value) {
# ifdef _LIBCPP_HAS_NO_UNICODE
# if !_LIBCPP_HAS_UNICODE
// For ASCII assume everything above 127 is printable.
if (__value > 127)
return false;

View File

@ -373,12 +373,12 @@ struct _LIBCPP_TEMPLATE_VIS hash<char32_t> : public __unary_function<char32_t, s
_LIBCPP_HIDE_FROM_ABI size_t operator()(char32_t __v) const _NOEXCEPT { return static_cast<size_t>(__v); }
};
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
struct _LIBCPP_TEMPLATE_VIS hash<wchar_t> : public __unary_function<wchar_t, size_t> {
_LIBCPP_HIDE_FROM_ABI size_t operator()(wchar_t __v) const _NOEXCEPT { return static_cast<size_t>(__v); }
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
template <>
struct _LIBCPP_TEMPLATE_VIS hash<short> : public __unary_function<short, size_t> {

View File

@ -32,7 +32,7 @@ using ifstream = basic_ifstream<char>;
using ofstream = basic_ofstream<char>;
using fstream = basic_fstream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
using wfilebuf = basic_filebuf<wchar_t>;
using wifstream = basic_ifstream<wchar_t>;
using wofstream = basic_ofstream<wchar_t>;

View File

@ -24,7 +24,7 @@ template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TEMPLATE_VIS basic_ios;
using ios = basic_ios<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
using wios = basic_ios<wchar_t>;
#endif

View File

@ -27,7 +27,7 @@ class _LIBCPP_TEMPLATE_VIS basic_iostream;
using istream = basic_istream<char>;
using iostream = basic_iostream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
using wistream = basic_istream<wchar_t>;
using wiostream = basic_iostream<wchar_t>;
#endif

View File

@ -23,7 +23,7 @@ class _LIBCPP_TEMPLATE_VIS basic_ostream;
using ostream = basic_ostream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
using wostream = basic_ostream<wchar_t>;
#endif

View File

@ -34,7 +34,7 @@ using istringstream = basic_istringstream<char>;
using ostringstream = basic_ostringstream<char>;
using stringstream = basic_stringstream<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
using wstringbuf = basic_stringbuf<wchar_t>;
using wistringstream = basic_istringstream<wchar_t>;
using wostringstream = basic_ostringstream<wchar_t>;

View File

@ -23,7 +23,7 @@ class _LIBCPP_TEMPLATE_VIS basic_streambuf;
using streambuf = basic_streambuf<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
using wstreambuf = basic_streambuf<wchar_t>;
#endif

View File

@ -34,7 +34,7 @@ struct char_traits<char16_t>;
template <>
struct char_traits<char32_t>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
struct char_traits<wchar_t>;
#endif
@ -44,7 +44,7 @@ class _LIBCPP_TEMPLATE_VIS basic_string;
using string = basic_string<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
using wstring = basic_string<wchar_t>;
#endif
@ -63,7 +63,7 @@ using basic_string _LIBCPP_AVAILABILITY_PMR = std::basic_string<_CharT, _Traits,
using string _LIBCPP_AVAILABILITY_PMR = basic_string<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
using wstring _LIBCPP_AVAILABILITY_PMR = basic_string<wchar_t>;
# endif
@ -80,7 +80,7 @@ using u32string _LIBCPP_AVAILABILITY_PMR = basic_string<char32_t>;
// clang-format off
template <class _CharT, class _Traits, class _Allocator>
class _LIBCPP_PREFERRED_NAME(string)
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_PREFERRED_NAME(wstring)
#endif
#if _LIBCPP_HAS_CHAR8_T
@ -90,7 +90,7 @@ class _LIBCPP_PREFERRED_NAME(string)
_LIBCPP_PREFERRED_NAME(u32string)
#if _LIBCPP_STD_VER >= 17
_LIBCPP_PREFERRED_NAME(pmr::string)
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_PREFERRED_NAME(pmr::wstring)
# endif
# if _LIBCPP_HAS_CHAR8_T

View File

@ -28,14 +28,14 @@ typedef basic_string_view<char8_t> u8string_view;
#endif
typedef basic_string_view<char16_t> u16string_view;
typedef basic_string_view<char32_t> u32string_view;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
typedef basic_string_view<wchar_t> wstring_view;
#endif
// clang-format off
template <class _CharT, class _Traits>
class _LIBCPP_PREFERRED_NAME(string_view)
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_PREFERRED_NAME(wstring_view)
#endif
#if _LIBCPP_HAS_CHAR8_T

View File

@ -27,7 +27,7 @@
#include <cstddef>
#include <cstring>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar>
#else
# include <__std_mbstate_t.h>
@ -236,7 +236,7 @@ long collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) cons
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>;
#endif
@ -263,7 +263,7 @@ protected:
string_type do_transform(const char_type* __lo, const char_type* __hi) const override;
};
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI collate_byname<wchar_t> : public collate<wchar_t> {
locale_t __l_;
@ -449,7 +449,7 @@ public:
template <class _CharT>
class _LIBCPP_TEMPLATE_VIS ctype;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI ctype<wchar_t> : public locale::facet, public ctype_base {
public:
@ -514,7 +514,7 @@ protected:
virtual const char_type*
do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const;
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI ctype<char> : public locale::facet, public ctype_base {
@ -630,7 +630,7 @@ protected:
const char_type* do_tolower(char_type* __low, const char_type* __high) const override;
};
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI ctype_byname<wchar_t> : public ctype<wchar_t> {
locale_t __l_;
@ -655,7 +655,7 @@ protected:
const char_type*
do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const override;
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
template <class _CharT>
inline _LIBCPP_HIDE_FROM_ABI bool isspace(_CharT __c, const locale& __loc) {
@ -821,7 +821,7 @@ protected:
// template <> class codecvt<wchar_t, char, mbstate_t>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI codecvt<wchar_t, char, mbstate_t> : public locale::facet, public codecvt_base {
locale_t __l_;
@ -900,7 +900,7 @@ protected:
virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
virtual int do_max_length() const _NOEXCEPT;
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
// template <> class codecvt<char16_t, char, mbstate_t> // deprecated in C++20
@ -1248,7 +1248,7 @@ codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname() {}
_LIBCPP_SUPPRESS_DEPRECATED_POP
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>;
#endif
extern template class _LIBCPP_DEPRECATED_IN_CXX20
@ -1438,7 +1438,7 @@ protected:
string __grouping_;
};
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI numpunct<wchar_t> : public locale::facet {
public:
@ -1467,7 +1467,7 @@ protected:
char_type __thousands_sep_;
string __grouping_;
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
// template <class charT> class numpunct_byname
@ -1490,7 +1490,7 @@ private:
void __init(const char*);
};
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI numpunct_byname<wchar_t> : public numpunct<wchar_t> {
public:
@ -1506,7 +1506,7 @@ protected:
private:
void __init(const char*);
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_END_NAMESPACE_STD

View File

@ -21,7 +21,7 @@
# include <__locale_dir/locale_base_api/openbsd.h>
#elif defined(__Fuchsia__)
# include <__locale_dir/locale_base_api/fuchsia.h>
#elif defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC)
#elif defined(__wasi__) || _LIBCPP_HAS_MUSL_LIBC
# include <__locale_dir/locale_base_api/musl.h>
#elif defined(__APPLE__)
# include <__locale_dir/locale_base_api/apple.h>

View File

@ -17,7 +17,7 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
# include <wchar.h>
#endif
@ -40,7 +40,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
inline _LIBCPP_HIDE_FROM_ABI decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __loc) { return MB_CUR_MAX_L(__loc); }
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI wint_t __libcpp_btowc_l(int __c, locale_t __loc) { return ::btowc_l(__c, __loc); }
inline _LIBCPP_HIDE_FROM_ABI int __libcpp_wctob_l(wint_t __c, locale_t __loc) { return ::wctob_l(__c, __loc); }
@ -71,11 +71,11 @@ inline _LIBCPP_HIDE_FROM_ABI int __libcpp_mbtowc_l(wchar_t* __pwc, const char* _
inline _LIBCPP_HIDE_FROM_ABI size_t __libcpp_mbrlen_l(const char* __s, size_t __n, mbstate_t* __ps, locale_t __loc) {
return ::mbrlen_l(__s, __n, __ps, __loc);
}
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI lconv* __libcpp_localeconv_l(locale_t& __loc) { return ::localeconv_l(__loc); }
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI size_t
__libcpp_mbsrtowcs_l(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps, locale_t __loc) {
return ::mbsrtowcs_l(__dest, __src, __len, __ps, __loc);

View File

@ -20,7 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar>
#endif
@ -35,7 +35,7 @@ inline _LIBCPP_HIDE_FROM_ABI decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t
return MB_CUR_MAX;
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI wint_t __libcpp_btowc_l(int __c, locale_t __l) {
__locale_guard __current(__l);
return btowc(__c);
@ -78,14 +78,14 @@ inline _LIBCPP_HIDE_FROM_ABI size_t __libcpp_mbrlen_l(const char* __s, size_t __
__locale_guard __current(__l);
return mbrlen(__s, __n, __ps);
}
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI lconv* __libcpp_localeconv_l(locale_t& __l) {
__locale_guard __current(__l);
return localeconv();
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI size_t
__libcpp_mbsrtowcs_l(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps, locale_t __l) {
__locale_guard __current(__l);

View File

@ -35,7 +35,7 @@
# define __CORRECT_ISO_CPP_WCHAR_H_PROTO
#endif
#if defined(_LIBCPP_HAS_MUSL_LIBC)
#if _LIBCPP_HAS_MUSL_LIBC
# define __NEED_mbstate_t
# include <bits/alltypes.h>
# undef __NEED_mbstate_t
@ -43,7 +43,7 @@
# include <bits/types/mbstate_t.h> // works on most Unixes
#elif __has_include(<sys/_types/_mbstate_t.h>)
# include <sys/_types/_mbstate_t.h> // works on Darwin
#elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) && __has_include_next(<wchar.h>)
#elif _LIBCPP_HAS_WIDE_CHARACTERS && __has_include_next(<wchar.h>)
# include_next <wchar.h> // fall back to the C standard provider of mbstate_t
#elif __has_include_next(<uchar.h>)
# include_next <uchar.h> // <uchar.h> is also required to make mbstate_t visible

View File

@ -83,7 +83,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _ValueType>
inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_relaxed_load(_ValueType const* __value) {
#if !defined(_LIBCPP_HAS_NO_THREADS) && defined(__ATOMIC_RELAXED) && \
#if _LIBCPP_HAS_THREADS && defined(__ATOMIC_RELAXED) && \
(__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
return __atomic_load_n(__value, __ATOMIC_RELAXED);
#else
@ -93,7 +93,7 @@ inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_relaxed_load(_ValueType const*
template <class _ValueType>
inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_acquire_load(_ValueType const* __value) {
#if !defined(_LIBCPP_HAS_NO_THREADS) && defined(__ATOMIC_ACQUIRE) && \
#if _LIBCPP_HAS_THREADS && defined(__ATOMIC_ACQUIRE) && \
(__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC))
return __atomic_load_n(__value, __ATOMIC_ACQUIRE);
#else
@ -103,7 +103,7 @@ inline _LIBCPP_HIDE_FROM_ABI _ValueType __libcpp_acquire_load(_ValueType const*
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT {
#if _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT && !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT && _LIBCPP_HAS_THREADS
return __atomic_add_fetch(&__t, 1, __ATOMIC_RELAXED);
#else
return __t += 1;
@ -112,7 +112,7 @@ inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_increment(_Tp& __t) _N
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT {
#if _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT && !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT && _LIBCPP_HAS_THREADS
return __atomic_add_fetch(&__t, -1, __ATOMIC_ACQ_REL);
#else
return __t -= 1;
@ -1584,7 +1584,7 @@ template <class _CharT, class _Traits, class _Yp>
inline _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
#if !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_HAS_THREADS
class _LIBCPP_EXPORTED_FROM_ABI __sp_mut {
void* __lx_;
@ -1686,7 +1686,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool atomic_compare_exchange_weak_explicit(
return std::atomic_compare_exchange_weak(__p, __v, __w);
}
#endif // !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -48,7 +48,7 @@ public:
synchronized_pool_resource& operator=(const synchronized_pool_resource&) = delete;
_LIBCPP_HIDE_FROM_ABI void release() {
# if !defined(_LIBCPP_HAS_NO_THREADS)
# if _LIBCPP_HAS_THREADS
unique_lock<mutex> __lk(__mut_);
# endif
__unsync_.release();
@ -60,14 +60,14 @@ public:
protected:
_LIBCPP_HIDE_FROM_ABI_VIRTUAL void* do_allocate(size_t __bytes, size_t __align) override {
# if !defined(_LIBCPP_HAS_NO_THREADS)
# if _LIBCPP_HAS_THREADS
unique_lock<mutex> __lk(__mut_);
# endif
return __unsync_.allocate(__bytes, __align);
}
_LIBCPP_HIDE_FROM_ABI_VIRTUAL void do_deallocate(void* __p, size_t __bytes, size_t __align) override {
# if !defined(_LIBCPP_HAS_NO_THREADS)
# if _LIBCPP_HAS_THREADS
unique_lock<mutex> __lk(__mut_);
# endif
return __unsync_.deallocate(__p, __bytes, __align);
@ -76,7 +76,7 @@ protected:
bool do_is_equal(const memory_resource& __other) const noexcept override; // key function
private:
# if !defined(_LIBCPP_HAS_NO_THREADS)
# if _LIBCPP_HAS_THREADS
mutex __mut_;
# endif
unsynchronized_pool_resource __unsync_;

View File

@ -17,7 +17,7 @@
# pragma GCC system_header
#endif
#ifndef _LIBCPP_HAS_NO_THREADS
#if _LIBCPP_HAS_THREADS
_LIBCPP_BEGIN_NAMESPACE_STD
@ -48,6 +48,6 @@ static_assert(is_nothrow_default_constructible<mutex>::value, "the default const
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_HAS_THREADS
#endif // _LIBCPP___MUTEX_MUTEX_H

View File

@ -11,7 +11,7 @@
#include <__config>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
# include <__exception/operations.h>
# include <__memory/shared_ptr.h>
@ -801,7 +801,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x) {
# if _LIBCPP_STD_VER >= 20
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <class _Traits>
basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete;
@ -820,7 +820,7 @@ basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, co
template <class _Traits>
basic_ostream<wchar_t, _Traits>& operator<<(basic_ostream<wchar_t, _Traits>&, const char32_t*) = delete;
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# if _LIBCPP_HAS_CHAR8_T
template <class _Traits>
@ -851,7 +851,7 @@ basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const ch
# endif // _LIBCPP_STD_VER >= 20
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;
# endif
@ -859,6 +859,6 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#endif // !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#endif // _LIBCPP_HAS_LOCALIZATION
#endif // _LIBCPP___OSTREAM_BASIC_OSTREAM_H

View File

@ -11,7 +11,7 @@
#include <__config>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
# include <__fwd/ostream.h>
# include <__iterator/ostreambuf_iterator.h>
@ -94,7 +94,7 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(ostream& __os, string_view _
// is determined in the same way as the print(FILE*, ...) overloads.
_LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os);
# ifndef _LIBCPP_HAS_NO_UNICODE
# if _LIBCPP_HAS_UNICODE
template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
_LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, format_args __args, bool __write_nl) {
# if _LIBCPP_AVAILABILITY_HAS_PRINT == 0
@ -122,7 +122,7 @@ _LIBCPP_HIDE_FROM_ABI void __vprint_unicode(ostream& __os, string_view __fmt, fo
if (__s) {
# ifndef _LIBCPP_WIN32API
__print::__vprint_unicode_posix(__file, __fmt, __args, __write_nl, true);
# elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
# elif _LIBCPP_HAS_WIDE_CHARACTERS
__print::__vprint_unicode_windows(__file, __fmt, __args, __write_nl, true);
# else
# error "Windows builds with wchar_t disabled are not supported."
@ -141,23 +141,23 @@ template <class = void> // TODO PRINT template or availability markup fires too
_LIBCPP_HIDE_FROM_ABI inline void vprint_unicode(ostream& __os, string_view __fmt, format_args __args) {
std::__vprint_unicode(__os, __fmt, __args, false);
}
# endif // _LIBCPP_HAS_NO_UNICODE
# endif // _LIBCPP_HAS_UNICODE
template <class... _Args>
_LIBCPP_HIDE_FROM_ABI void print(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) {
# ifndef _LIBCPP_HAS_NO_UNICODE
# if _LIBCPP_HAS_UNICODE
if constexpr (__print::__use_unicode_execution_charset)
std::__vprint_unicode(__os, __fmt.get(), std::make_format_args(__args...), false);
else
std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), false);
# else // _LIBCPP_HAS_NO_UNICODE
# else // _LIBCPP_HAS_UNICODE
std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), false);
# endif // _LIBCPP_HAS_NO_UNICODE
# endif // _LIBCPP_HAS_UNICODE
}
template <class... _Args>
_LIBCPP_HIDE_FROM_ABI void println(ostream& __os, format_string<_Args...> __fmt, _Args&&... __args) {
# ifndef _LIBCPP_HAS_NO_UNICODE
# if _LIBCPP_HAS_UNICODE
// Note the wording in the Standard is inefficient. The output of
// std::format is a std::string which is then copied. This solution
// just appends a newline at the end of the output.
@ -165,9 +165,9 @@ _LIBCPP_HIDE_FROM_ABI void println(ostream& __os, format_string<_Args...> __fmt,
std::__vprint_unicode(__os, __fmt.get(), std::make_format_args(__args...), true);
else
std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), true);
# else // _LIBCPP_HAS_NO_UNICODE
# else // _LIBCPP_HAS_UNICODE
std::__vprint_nonunicode(__os, __fmt.get(), std::make_format_args(__args...), true);
# endif // _LIBCPP_HAS_NO_UNICODE
# endif // _LIBCPP_HAS_UNICODE
}
template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
@ -179,6 +179,6 @@ _LIBCPP_HIDE_FROM_ABI inline void println(ostream& __os) {
_LIBCPP_END_NAMESPACE_STD
#endif // !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#endif // _LIBCPP_HAS_LOCALIZATION
#endif // _LIBCPP___OSTREAM_PRINT_H

View File

@ -21,7 +21,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
#if !defined(_LIBCPP_HAS_NO_RANDOM_DEVICE)
#if _LIBCPP_HAS_RANDOM_DEVICE
class _LIBCPP_EXPORTED_FROM_ABI random_device {
# ifdef _LIBCPP_USING_DEV_RANDOM
@ -72,7 +72,7 @@ public:
void operator=(const random_device&) = delete;
};
#endif // !_LIBCPP_HAS_NO_RANDOM_DEVICE
#endif // _LIBCPP_HAS_RANDOM_DEVICE
_LIBCPP_END_NAMESPACE_STD

View File

@ -99,7 +99,7 @@ private:
template <class _Val>
using istream_view = basic_istream_view<_Val, char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <class _Val>
using wistream_view = basic_istream_view<_Val, wchar_t>;
# endif

View File

@ -133,7 +133,7 @@ private:
_LIBCPP_HIDE_FROM_ABI static constexpr auto __set_locked_bit = [](_State __state) { return __state | _LockedBit; };
};
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -31,7 +31,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
template <class _Callback>
class _LIBCPP_AVAILABILITY_SYNC stop_callback : private __stop_callback_base {
@ -93,7 +93,7 @@ private:
template <class _Callback>
_LIBCPP_AVAILABILITY_SYNC stop_callback(stop_token, _Callback) -> stop_callback<_Callback>;
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
struct nostopstate_t {
explicit nostopstate_t() = default;
@ -84,7 +84,7 @@ private:
__intrusive_shared_ptr<__stop_state> __state_;
};
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -24,7 +24,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
struct __stop_callback_base : __intrusive_node_base<__stop_callback_base> {
using __callback_fn_t = void(__stop_callback_base*) noexcept;
@ -229,7 +229,7 @@ struct __intrusive_shared_ptr_traits<__stop_state> {
}
};
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -20,7 +20,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
class _LIBCPP_AVAILABILITY_SYNC stop_token {
public:
@ -56,7 +56,7 @@ private:
_LIBCPP_HIDE_FROM_ABI explicit stop_token(const __intrusive_shared_ptr<__stop_state>& __state) : __state_(__state) {}
};
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -29,7 +29,7 @@
#include <cstdio>
#include <iosfwd>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar> // for wmemcpy
#endif
@ -234,7 +234,7 @@ struct __char_traits_base {
// char_traits<wchar_t>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t> : __char_traits_base<wchar_t, wint_t, static_cast<wint_t>(WEOF)> {
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int
@ -255,7 +255,7 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t> : __char_traits_base<wchar_t, w
return std::__constexpr_wmemchr(__s, __a, __n);
}
};
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
#if _LIBCPP_HAS_CHAR8_T

View File

@ -20,7 +20,7 @@
#include <string.h>
#include <time.h>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
# include <wchar.h>
# include <wctype.h>
#endif
@ -37,7 +37,7 @@ inline _LIBCPP_HIDE_FROM_ABI int toupper_l(int __c, locale_t) { return ::toupper
inline _LIBCPP_HIDE_FROM_ABI int tolower_l(int __c, locale_t) { return ::tolower(__c); }
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI int iswalpha_l(wint_t __c, locale_t) { return ::iswalpha(__c); }
inline _LIBCPP_HIDE_FROM_ABI int iswblank_l(wint_t __c, locale_t) { return ::iswblank(__c); }
@ -61,7 +61,7 @@ inline _LIBCPP_HIDE_FROM_ABI int iswxdigit_l(wint_t __c, locale_t) { return ::is
inline _LIBCPP_HIDE_FROM_ABI wint_t towupper_l(wint_t __c, locale_t) { return ::towupper(__c); }
inline _LIBCPP_HIDE_FROM_ABI wint_t towlower_l(wint_t __c, locale_t) { return ::towlower(__c); }
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI int strcoll_l(const char* __s1, const char* __s2, locale_t) {
return ::strcoll(__s1, __s2);
@ -76,7 +76,7 @@ strftime_l(char* __s, size_t __max, const char* __format, const struct tm* __tm,
return ::strftime(__s, __max, __format, __tm);
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
inline _LIBCPP_HIDE_FROM_ABI int wcscoll_l(const wchar_t* __ws1, const wchar_t* __ws2, locale_t) {
return ::wcscoll(__ws1, __ws2);
}
@ -84,6 +84,6 @@ inline _LIBCPP_HIDE_FROM_ABI int wcscoll_l(const wchar_t* __ws1, const wchar_t*
inline _LIBCPP_HIDE_FROM_ABI size_t wcsxfrm_l(wchar_t* __dest, const wchar_t* __src, size_t __n, locale_t) {
return ::wcsxfrm(__dest, __src, __n);
}
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
#endif // _LIBCPP_HAS_WIDE_CHARACTERS
#endif // _LIBCPP___SUPPORT_XLOCALE_POSIX_L_FALLBACK_H

View File

@ -18,7 +18,7 @@
#include <__config>
#include <stdlib.h>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
# include <wchar.h>
#endif

View File

@ -31,7 +31,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
# ifndef _LIBCPP_HAS_NO_THREADS
# if _LIBCPP_HAS_THREADS
template <__fmt_char_type _CharT>
struct _LIBCPP_TEMPLATE_VIS formatter<__thread_id, _CharT> {
@ -71,7 +71,7 @@ public:
__format_spec::__parser<_CharT> __parser_{.__alignment_ = __format_spec::__alignment::__right};
};
# endif // !_LIBCPP_HAS_NO_THREADS
# endif // _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_THREADS
#if _LIBCPP_HAS_THREADS
class _LIBCPP_EXPORTED_FROM_ABI __thread_id;
namespace this_thread {
@ -114,7 +114,7 @@ inline _LIBCPP_HIDE_FROM_ABI __thread_id get_id() _NOEXCEPT { return __libcpp_th
} // namespace this_thread
#endif // !_LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -32,7 +32,7 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
_LIBCPP_BEGIN_NAMESPACE_STD
@ -129,7 +129,7 @@ private:
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS
_LIBCPP_POP_MACROS

View File

@ -104,20 +104,20 @@ _LIBCPP_END_NAMESPACE_STD
*/
#if !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_HAS_THREADS
# if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
# if _LIBCPP_HAS_THREAD_API_EXTERNAL
# include <__thread/support/external.h>
# elif defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
# elif _LIBCPP_HAS_THREAD_API_PTHREAD
# include <__thread/support/pthread.h>
# elif defined(_LIBCPP_HAS_THREAD_API_C11)
# elif _LIBCPP_HAS_THREAD_API_C11
# include <__thread/support/c11.h>
# elif defined(_LIBCPP_HAS_THREAD_API_WIN32)
# elif _LIBCPP_HAS_THREAD_API_WIN32
# include <__thread/support/windows.h>
# else
# error "No threading API was selected"
# endif
#endif // !_LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_HAS_THREADS
#endif // _LIBCPP___THREAD_SUPPORT_H

View File

@ -30,7 +30,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace this_thread {
#ifndef _LIBCPP_HAS_NO_THREADS
#if _LIBCPP_HAS_THREADS
_LIBCPP_EXPORTED_FROM_ABI void sleep_for(const chrono::nanoseconds& __ns);
@ -68,7 +68,7 @@ inline _LIBCPP_HIDE_FROM_ABI void sleep_until(const chrono::time_point<chrono::s
inline _LIBCPP_HIDE_FROM_ABI void yield() _NOEXCEPT { __libcpp_thread_yield(); }
#endif // !_LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_HAS_THREADS
} // namespace this_thread

View File

@ -25,7 +25,7 @@
#include <__utility/forward.h>
#include <tuple>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION
# include <locale>
# include <sstream>
#endif
@ -39,7 +39,7 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
#if !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_HAS_THREADS
template <class _Tp>
class __thread_specific_ptr;
@ -121,7 +121,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<__thread_id> : public __unary_function<__thread
}
};
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
# if _LIBCPP_HAS_LOCALIZATION
template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) {
@ -146,7 +146,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) {
__sstr << __id.__id_;
return __os << __sstr.str();
}
# endif // _LIBCPP_HAS_NO_LOCALIZATION
# endif // _LIBCPP_HAS_LOCALIZATION
class _LIBCPP_EXPORTED_FROM_ABI thread {
__libcpp_thread_t __t_;
@ -255,7 +255,7 @@ thread::thread(_Fp __f) {
inline _LIBCPP_HIDE_FROM_ABI void swap(thread& __x, thread& __y) _NOEXCEPT { __x.swap(__y); }
#endif // !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_HAS_THREADS
_LIBCPP_END_NAMESPACE_STD

View File

@ -12,7 +12,7 @@
#include <__config>
#ifndef _LIBCPP_HAS_NO_THREADS
#if _LIBCPP_HAS_THREADS
# include <__chrono/duration.h>
# include <__thread/support.h>
@ -39,6 +39,6 @@ struct __libcpp_timed_backoff_policy {
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_HAS_THREADS
#endif // _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H

View File

@ -25,7 +25,7 @@ template <> struct __libcpp_is_integral<bool> { enum { va
template <> struct __libcpp_is_integral<char> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<signed char> { enum { value = 1 }; };
template <> struct __libcpp_is_integral<unsigned char> { enum { value = 1 }; };
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
template <> struct __libcpp_is_integral<wchar_t> { enum { value = 1 }; };
#endif
#if _LIBCPP_HAS_CHAR8_T

View File

@ -1381,7 +1381,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 bool vector<_Tp, _Allocator>::__invariants() const
#if _LIBCPP_STD_VER >= 20
template <>
inline constexpr bool __format::__enable_insertable<vector<char>> = true;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
inline constexpr bool __format::__enable_insertable<vector<wchar_t>> = true;
# endif

View File

@ -47,7 +47,7 @@ namespace std
#include <__config>
#if !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_HAS_THREADS
# include <__assert>
# include <__atomic/atomic_base.h>
@ -294,7 +294,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#endif // !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_HAS_THREADS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>

View File

@ -965,15 +965,14 @@ constexpr chrono::year operator ""y(unsigned lo
# include <__chrono/year_month_day.h>
# include <__chrono/year_month_weekday.h>
# if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_HAS_LOCALIZATION
# include <__chrono/formatter.h>
# include <__chrono/ostream.h>
# include <__chrono/parser_std_format_spec.h>
# include <__chrono/statically_widen.h>
# endif
# if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
!defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
# include <__chrono/leap_second.h>
# include <__chrono/time_zone.h>
# include <__chrono/time_zone_link.h>
@ -1014,7 +1013,7 @@ constexpr chrono::year operator ""y(unsigned lo
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 20
# include <charconv>
# if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
# if _LIBCPP_HAS_LOCALIZATION
# include <locale>
# include <ostream>
# endif

View File

@ -73,7 +73,7 @@ enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_hea
template <class _Elem>
class __codecvt_utf8;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
unsigned long __maxcode_;
@ -112,7 +112,7 @@ protected:
int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
int do_max_length() const _NOEXCEPT override;
};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
@ -203,7 +203,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
template <class _Elem, bool _LittleEndian>
class __codecvt_utf16;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16<wchar_t, false> : public codecvt<wchar_t, char, mbstate_t> {
unsigned long __maxcode_;
@ -281,7 +281,7 @@ protected:
int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
int do_max_length() const _NOEXCEPT override;
};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>
@ -448,7 +448,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
template <class _Elem>
class __codecvt_utf8_utf16;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16<wchar_t> : public codecvt<wchar_t, char, mbstate_t> {
unsigned long __maxcode_;
@ -487,7 +487,7 @@ protected:
int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override;
int do_max_length() const _NOEXCEPT override;
};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <>

View File

@ -266,7 +266,7 @@ template<class T> complex<T> tanh (const complex<T>&);
#include <cmath>
#include <version>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
# include <sstream> // for std::basic_ostringstream
#endif
@ -1322,7 +1322,7 @@ _LIBCPP_HIDE_FROM_ABI complex<_Tp> tan(const complex<_Tp>& __x) {
return complex<_Tp>(__z.imag(), -__z.real());
}
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
template <class _Tp, class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) {
@ -1379,7 +1379,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x) {
__s << '(' << __x.real() << ',' << __x.imag() << ')';
return __os << __s.str();
}
#endif // !_LIBCPP_HAS_NO_LOCALIZATION
#endif // _LIBCPP_HAS_LOCALIZATION
#if _LIBCPP_STD_VER >= 26

View File

@ -140,7 +140,7 @@ public:
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
#ifndef _LIBCPP_HAS_NO_THREADS
#if _LIBCPP_HAS_THREADS
_LIBCPP_BEGIN_NAMESPACE_STD
@ -347,7 +347,7 @@ _LIBCPP_EXPORTED_FROM_ABI void notify_all_at_thread_exit(condition_variable&, un
_LIBCPP_END_NAMESPACE_STD
#endif // !_LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_HAS_THREADS
_LIBCPP_POP_MACROS

View File

@ -135,7 +135,7 @@ using ::div _LIBCPP_USING_IF_EXISTS;
using ::ldiv _LIBCPP_USING_IF_EXISTS;
using ::lldiv _LIBCPP_USING_IF_EXISTS;
using ::mblen _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
using ::mbtowc _LIBCPP_USING_IF_EXISTS;
using ::wctomb _LIBCPP_USING_IF_EXISTS;
using ::mbstowcs _LIBCPP_USING_IF_EXISTS;

View File

@ -2604,7 +2604,7 @@ erase_if(deque<_Tp, _Allocator>& __c, _Predicate __pred) {
template <>
inline constexpr bool __format::__enable_insertable<std::deque<char>> = true;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
inline constexpr bool __format::__enable_insertable<std::deque<wchar_t>> = true;
# endif

View File

@ -252,7 +252,7 @@ namespace std {
# include <string_view>
# include <tuple>
# if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
# if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar>
# endif
#endif

View File

@ -217,7 +217,7 @@ _LIBCPP_PUSH_MACROS
# define _LIBCPP_HAS_OFF_T_FUNCTIONS 0
#endif
#if !defined(_LIBCPP_HAS_NO_FILESYSTEM) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
_LIBCPP_BEGIN_NAMESPACE_STD
@ -1562,7 +1562,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>;
_LIBCPP_END_NAMESPACE_STD
#endif // !defined(_LIBCPP_HAS_NO_FILESYSTEM) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#endif // _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
_LIBCPP_POP_MACROS

View File

@ -364,7 +364,7 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
#include <__config>
#if !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_HAS_THREADS
# include <__assert>
# include <__chrono/duration.h>
@ -2059,7 +2059,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#endif // !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_HAS_THREADS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
# include <chrono>

View File

@ -44,7 +44,7 @@ template <class charT, class traits, class Allocator>
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION
# include <__ostream/basic_ostream.h>
# include <ios>
@ -544,6 +544,6 @@ quoted(basic_string_view<_CharT, _Traits> __sv, _CharT __delim = _CharT('"'), _C
_LIBCPP_END_NAMESPACE_STD
#endif // !_LIBCPP_HAS_NO_LOCALIZATION
#endif // _LIBCPP_HAS_LOCALIZATION
#endif // _LIBCPP_IOMANIP

View File

@ -213,7 +213,7 @@ storage-class-specifier const error_category& iostream_category() noexcept;
#include <__config>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
# include <__fwd/ios.h>
# include <__ios/fpos.h>
@ -397,7 +397,7 @@ private:
size_t __event_cap_;
// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
// enabled with clang.
# if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
# if _LIBCPP_HAS_C_ATOMIC_IMP && _LIBCPP_HAS_THREADS
static atomic<int> __xindex_;
# else
static int __xindex_;
@ -744,7 +744,7 @@ inline _LIBCPP_HIDE_FROM_ABI void basic_ios<_CharT, _Traits>::set_rdbuf(basic_st
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>;
# endif
@ -872,7 +872,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#endif // !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#endif // _LIBCPP_HAS_LOCALIZATION
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>

View File

@ -131,7 +131,7 @@ class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
template <class _State>
class _LIBCPP_TEMPLATE_VIS fpos;
typedef fpos<mbstate_t> streampos;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
typedef fpos<mbstate_t> wstreampos;
#endif
#if _LIBCPP_HAS_CHAR8_T
@ -146,7 +146,7 @@ template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator =
class basic_syncbuf;
using syncbuf = basic_syncbuf<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
using wsyncbuf = basic_syncbuf<wchar_t>;
# endif
@ -154,7 +154,7 @@ template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator =
class basic_osyncstream;
using osyncstream = basic_osyncstream<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
using wosyncstream = basic_osyncstream<wchar_t>;
# endif

View File

@ -55,7 +55,7 @@ extern _LIBCPP_EXPORTED_FROM_ABI ostream cout;
extern _LIBCPP_EXPORTED_FROM_ABI ostream cerr;
extern _LIBCPP_EXPORTED_FROM_ABI ostream clog;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
extern _LIBCPP_EXPORTED_FROM_ABI wistream wcin;
extern _LIBCPP_EXPORTED_FROM_ABI wostream wcout;
extern _LIBCPP_EXPORTED_FROM_ABI wostream wcerr;

View File

@ -160,7 +160,7 @@ template <class Stream, class T>
#include <__config>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
# include <__fwd/istream.h>
# include <__iterator/istreambuf_iterator.h>
@ -1363,14 +1363,14 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x) {
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>;
# endif
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>;
_LIBCPP_END_NAMESPACE_STD
#endif // !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#endif // _LIBCPP_HAS_LOCALIZATION
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <concepts>

View File

@ -42,7 +42,7 @@ namespace std
#include <__config>
#if !defined(_LIBCPP_HAS_NO_THREADS)
#if _LIBCPP_HAS_THREADS
# include <__assert>
# include <__atomic/atomic_base.h>
@ -120,7 +120,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
#endif // !defined(_LIBCPP_HAS_NO_THREADS)
#endif // _LIBCPP_HAS_THREADS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>

View File

@ -1710,7 +1710,7 @@ erase(list<_Tp, _Allocator>& __c, const _Up& __v) {
template <>
inline constexpr bool __format::__enable_insertable<std::list<char>> = true;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
inline constexpr bool __format::__enable_insertable<std::list<wchar_t>> = true;
# endif

View File

@ -189,7 +189,7 @@ template <class charT> class messages_byname;
#include <__config>
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#if _LIBCPP_HAS_LOCALIZATION
# include <__algorithm/copy.h>
# include <__algorithm/equal.h>
@ -580,7 +580,7 @@ int __num_get<_CharT>::__stage2_float_loop(
}
extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>;
# endif
@ -1051,7 +1051,7 @@ _InputIterator num_get<_CharT, _InputIterator>::do_get(
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>;
# endif
@ -1169,7 +1169,7 @@ void __num_put<_CharT>::__widen_and_group_float(
}
extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>;
# endif
@ -1456,7 +1456,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_ty
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>;
# endif
@ -1523,7 +1523,7 @@ _LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__x() const;
template <>
_LIBCPP_EXPORTED_FROM_ABI const string& __time_get_c_storage<char>::__X() const;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
_LIBCPP_EXPORTED_FROM_ABI const wstring* __time_get_c_storage<wchar_t>::__weeks() const;
template <>
@ -1992,7 +1992,7 @@ _InputIterator time_get<_CharT, _InputIterator>::do_get(
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>;
# endif
@ -2052,7 +2052,7 @@ private:
/**/
_LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(char)
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
_LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION(wchar_t)
# endif
# undef _LIBCPP_TIME_GET_STORAGE_EXPLICIT_INSTANTIATION
@ -2088,7 +2088,7 @@ private:
};
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>;
# endif
@ -2101,7 +2101,7 @@ protected:
__time_put(const string& __nm);
~__time_put();
void __do_put(char* __nb, char*& __ne, const tm* __tm, char __fmt, char __mod) const;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
void __do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm, char __fmt, char __mod) const;
# endif
};
@ -2177,7 +2177,7 @@ _OutputIterator time_put<_CharT, _OutputIterator>::do_put(
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>;
# endif
@ -2195,7 +2195,7 @@ protected:
};
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>;
# endif
@ -2262,7 +2262,7 @@ const bool moneypunct<_CharT, _International>::intl;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>;
# endif
@ -2320,7 +2320,7 @@ _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<char, true>::init(const char*);
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>;
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
template <>
_LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname<wchar_t, false>::init(const char*);
template <>
@ -2388,7 +2388,7 @@ void __money_get<_CharT>::__gather_info(
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>;
# endif
@ -2698,7 +2698,7 @@ _InputIterator money_get<_CharT, _InputIterator>::do_get(
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>;
# endif
@ -2876,7 +2876,7 @@ void __money_put<_CharT>::__format(
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>;
# endif
@ -3022,7 +3022,7 @@ _OutputIterator money_put<_CharT, _OutputIterator>::do_put(
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>;
# endif
@ -3107,7 +3107,7 @@ void messages<_CharT>::do_close(catalog __c) const {
}
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>;
# endif
@ -3126,7 +3126,7 @@ protected:
};
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# if _LIBCPP_HAS_WIDE_CHARACTERS
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>;
# endif
@ -3745,7 +3745,7 @@ _LIBCPP_POP_MACROS
// NOLINTEND(libcpp-robust-against-adl)
#endif // !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#endif // _LIBCPP_HAS_LOCALIZATION
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>

Some files were not shown because too many files have changed in this diff Show More