Skip to content

Commit

Permalink
[libc++] Refactor the configuration macros to being always defined
Browse files Browse the repository at this point in the history
  • Loading branch information
philnik777 committed Oct 12, 2024
1 parent 9f24c14 commit c44ba76
Show file tree
Hide file tree
Showing 210 changed files with 984 additions and 1,012 deletions.
22 changes: 11 additions & 11 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -741,24 +741,24 @@ 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_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_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)

if (LIBCXX_ENABLE_ASSERTIONS)
message(DEPRECATION "LIBCXX_ENABLE_ASSERTIONS is deprecated and will be removed in LLVM 20. Please use LIBCXX_HARDENING_MODE instead.")
Expand Down
6 changes: 3 additions & 3 deletions libcxx/docs/DesignDocs/ThreadingSupportAPI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>``
Expand Down
6 changes: 3 additions & 3 deletions libcxx/include/__algorithm/find.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <__utility/move.h>
#include <limits>

#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
#if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar>
#endif

Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions libcxx/include/__algorithm/lexicographical_compare.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__algorithm/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,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
Expand Down Expand Up @@ -941,7 +941,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,
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__atomic/aliases.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,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

Expand Down
6 changes: 3 additions & 3 deletions libcxx/include/__atomic/atomic_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions libcxx/include/__chrono/convert_to_tm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()});
Expand Down
24 changes: 11 additions & 13 deletions libcxx/include/__chrono/formatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <__config>

#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION

# include <__algorithm/ranges_copy.h>
# include <__chrono/calendar.h>
Expand Down Expand Up @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -964,7 +962,7 @@ struct formatter<chrono::local_info, _CharT> : public __formatter_chrono<_CharT>
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>
Expand All @@ -977,13 +975,13 @@ struct formatter<chrono::zoned_time<_Duration, _TimeZonePtr>, _CharT> : 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
2 changes: 1 addition & 1 deletion libcxx/include/__chrono/high_resolution_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions libcxx/include/__chrono/ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <__config>

#ifndef _LIBCPP_HAS_NO_LOCALIZATION
#if _LIBCPP_HAS_LOCALIZATION

# include <__chrono/calendar.h>
# include <__chrono/day.h>
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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) {
Expand All @@ -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
4 changes: 2 additions & 2 deletions libcxx/include/__chrono/parser_std_format_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -416,6 +416,6 @@ class _LIBCPP_TEMPLATE_VIS __parser_chrono {

_LIBCPP_END_NAMESPACE_STD

#endif // !defined(_LIBCPP_HAS_NO_LOCALIZATION)
#endif // _LIBCPP_HAS_LOCALIZATION

#endif // _LIBCPP___CHRONO_PARSER_STD_FORMAT_SPEC_H
6 changes: 3 additions & 3 deletions libcxx/include/__chrono/statically_widen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>)
Expand All @@ -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.
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__chrono/steady_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions libcxx/include/__chrono/time_zone.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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

Expand Down
Loading

0 comments on commit c44ba76

Please sign in to comment.