From 62bd0c51f3c5bcdf05b0e70e3c16e4beeb60d9c0 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 11:07:32 +0300 Subject: [PATCH 01/36] Towards #351. Product headers --- GitExtensions.settings | 11 +++++++++++ stl/inc/__msvc_bit_utils.hpp | 8 ++++---- stl/inc/__msvc_filebuf.hpp | 4 ++-- stl/inc/atomic | 4 ++-- stl/inc/deque | 16 ++++++++-------- stl/inc/exception | 8 ++++---- stl/inc/forward_list | 8 ++++---- stl/inc/functional | 12 ++++++------ stl/inc/iosfwd | 4 ++-- stl/inc/iostream | 4 ++-- stl/inc/istream | 2 +- stl/inc/list | 8 ++++---- stl/inc/memory | 32 ++++++++++++++++---------------- stl/inc/ostream | 4 ++-- stl/inc/random | 4 ++-- stl/inc/regex | 14 ++++++-------- stl/inc/type_traits | 22 ++++++++++------------ stl/inc/utility | 4 ++-- stl/inc/variant | 4 ++-- stl/inc/vector | 12 ++++++------ stl/inc/xatomic.h | 4 ++-- stl/inc/xhash | 4 ++-- stl/inc/xlocale | 4 ++-- stl/inc/xlocinfo | 16 ++++++++-------- stl/inc/xmemory | 24 ++++++++++++------------ stl/inc/xstring | 32 ++++++++++++++++---------------- stl/inc/xthreads.h | 24 ++++++++++++------------ stl/inc/xutility | 4 ++-- stl/inc/yvals.h | 28 ++++++++++++++-------------- stl/inc/yvals_core.h | 36 ++++++++++++++++++------------------ 30 files changed, 184 insertions(+), 177 deletions(-) create mode 100644 GitExtensions.settings diff --git a/GitExtensions.settings b/GitExtensions.settings new file mode 100644 index 0000000000..684f9b0c2d --- /dev/null +++ b/GitExtensions.settings @@ -0,0 +1,11 @@ + + + + + 2ec3e1f0-ef37-413f-bea5-b8fe1f9c505c.OAuth Token + + + + + + \ No newline at end of file diff --git a/stl/inc/__msvc_bit_utils.hpp b/stl/inc/__msvc_bit_utils.hpp index 89d5d4c194..3af1de66a4 100644 --- a/stl/inc/__msvc_bit_utils.hpp +++ b/stl/inc/__msvc_bit_utils.hpp @@ -128,14 +128,14 @@ template _NODISCARD int _Checked_x86_x64_countl_zero(const _Ty _Val) noexcept { #ifdef __AVX2__ return _Countl_zero_lzcnt(_Val); -#else // __AVX2__ +#else // ^^^ __AVX2__ ^^^ / vvv !__AVX2__ vvv const bool _Definitely_have_lzcnt = __isa_available >= _Stl_isa_available_avx2; if (_Definitely_have_lzcnt) { return _Countl_zero_lzcnt(_Val); } else { return _Countl_zero_bsr(_Val); } -#endif // __AVX2__ +#endif // ^^^ !__AVX2__ ^^^ } #endif // defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) @@ -299,14 +299,14 @@ template _NODISCARD int _Checked_x86_x64_countr_zero(const _Ty _Val) noexcept { #ifdef __AVX2__ return _Countr_zero_tzcnt(_Val); -#else // __AVX2__ +#else // ^^^ __AVX2__ ^^^ / vvv !__AVX2__ vvv const bool _Definitely_have_tzcnt = __isa_available >= _Stl_isa_available_avx2; if (_Definitely_have_tzcnt) { return _Countr_zero_tzcnt(_Val); } else { return _Countr_zero_bsf(_Val); } -#endif // __AVX2__ +#endif // ^^^ !__AVX2__ ^^^ } #endif // _HAS_TZCNT_BSF_INTRINSICS diff --git a/stl/inc/__msvc_filebuf.hpp b/stl/inc/__msvc_filebuf.hpp index 7e420846cf..55d409f77c 100644 --- a/stl/inc/__msvc_filebuf.hpp +++ b/stl/inc/__msvc_filebuf.hpp @@ -35,9 +35,9 @@ namespace filesystem { #ifndef _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM #ifdef _M_CEE #define _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM 0 -#else // _M_CEE +#else #define _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM 1 -#endif // _M_CEE +#endif #endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM #if _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM diff --git a/stl/inc/atomic b/stl/inc/atomic index 9f9c0aec27..394b9a1389 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -670,9 +670,9 @@ struct _Atomic_storage { } else { _Result = _CSTD memcmp(_Storage_ptr, _Expected_ptr, sizeof(_TVal)) == 0; } -#else // _CMPXCHG_MASK_OUT_PADDING_BITS +#else // ^^^ _CMPXCHG_MASK_OUT_PADDING_BITS ^^^ / vvv !_CMPXCHG_MASK_OUT_PADDING_BITS vvv _Result = _CSTD memcmp(_Storage_ptr, _Expected_ptr, sizeof(_TVal)) == 0; -#endif // _CMPXCHG_MASK_OUT_PADDING_BITS +#endif // ^^^ _CMPXCHG_MASK_OUT_PADDING_BITS ^^^ if (_Result) { _CSTD memcpy(_Storage_ptr, _STD addressof(_Desired), sizeof(_TVal)); } else { diff --git a/stl/inc/deque b/stl/inc/deque index 9eb2cfd6f4..19cc6ae414 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -389,9 +389,9 @@ public: void _Compat(const _Deque_const_iterator& _Right) const noexcept { // test for compatible iterator pair #if _ITERATOR_DEBUG_LEVEL == 0 (void) _Right; -#else // _ITERATOR_DEBUG_LEVEL == 0 +#else _STL_VERIFY(this->_Getcont() == _Right._Getcont(), "deque iterators incompatible"); -#endif // _ITERATOR_DEBUG_LEVEL == 0 +#endif } void _Setcont(const _Mydeque* _Pdeque) noexcept { // set container pointer @@ -1134,7 +1134,7 @@ public: } } -#else // _ITERATOR_DEBUG_LEVEL == 2 +#else // ^^^_ITERATOR_DEBUG_LEVEL == 2 ^^^ / vvv _ITERATOR_DEBUG_LEVEL < 2 vvv size_type _Block = _Getblock(_Myoff()); _Alty_traits::destroy(_Getal(), _Unfancy(_Map()[_Block] + _Myoff() % _Block_size)); if (--_Mysize() == 0) { @@ -1142,7 +1142,7 @@ public: } else { ++_Myoff(); } -#endif // _ITERATOR_DEBUG_LEVEL == 2 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ } private: @@ -1203,14 +1203,14 @@ public: } } -#else // _ITERATOR_DEBUG_LEVEL == 2 +#else // ^^^_ITERATOR_DEBUG_LEVEL == 2 ^^^ / vvv _ITERATOR_DEBUG_LEVEL < 2 vvv size_type _Newoff = _Myoff() + _Mysize() - 1; size_type _Block = _Getblock(_Newoff); _Alty_traits::destroy(_Getal(), _Unfancy(_Map()[_Block] + _Newoff % _Block_size)); if (--_Mysize() == 0) { _Myoff() = 0; } -#endif // _ITERATOR_DEBUG_LEVEL == 2 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ } private: @@ -1414,10 +1414,10 @@ public: auto _Count = static_cast(_Last - _First); bool _Moved = _Off > 0 && _Off + _Count < _Mysize(); -#else // _ITERATOR_DEBUG_LEVEL == 2 +#else // ^^^_ITERATOR_DEBUG_LEVEL == 2 ^^^ / vvv _ITERATOR_DEBUG_LEVEL < 2 vvv auto _Off = static_cast(_First - begin()); auto _Count = static_cast(_Last - _First); -#endif // _ITERATOR_DEBUG_LEVEL == 2 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ if (_Count == 0) { return _First; diff --git a/stl/inc/exception b/stl/inc/exception index e812966eb3..da37457613 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -67,7 +67,7 @@ _NODISCARD inline unexpected_handler __CRTDECL get_unexpected() noexcept { _STD_END -#else // _HAS_EXCEPTIONS +#else // ^^^ _HAS_EXCEPTIONS ^^^ / vvv !_HAS_EXCEPTIONS vvv _STDEXT_BEGIN class exception; @@ -392,10 +392,10 @@ void rethrow_if_nested(const _Ty& _Arg) { } } } -#else // _CPPRTTI +#else // ^^^ _CPPRTTI ^^^ / vvv !_CPPRTTI vvv _EXPORT_STD template void rethrow_if_nested(const _Ty&) = delete; // requires /GR option -#endif // _CPPRTTI +#endif // ^^^ !_CPPRTTI ^^^ _EXPORT_STD class bad_variant_access : public exception { // exception for visit of a valueless variant or get on a variant with index() != I @@ -411,7 +411,7 @@ protected: void _Doraise() const override { // perform class-specific exception handling _RAISE(*this); } -#endif // !_HAS_EXCEPTIONS +#endif // ^^^!_HAS_EXCEPTIONS ^^^ }; [[noreturn]] inline void _Throw_bad_variant_access() { diff --git a/stl/inc/forward_list b/stl/inc/forward_list index 1e70f99f0c..c68cca5247 100644 --- a/stl/inc/forward_list +++ b/stl/inc/forward_list @@ -1228,9 +1228,9 @@ public: #if _HAS_CXX20 return _Removed; -#else // _HAS_CXX20 +#else (void) _Removed; -#endif // _HAS_CXX20 +#endif } auto unique() { // erase each element matching previous @@ -1258,9 +1258,9 @@ public: #if _HAS_CXX20 return _Removed; -#else // _HAS_CXX20 +#else (void) _Removed; -#endif // _HAS_CXX20 +#endif } void merge(forward_list& _Right) { // merge in elements from _Right, both ordered by operator< diff --git a/stl/inc/functional b/stl/inc/functional index a2ef1f8515..c1de0b6d08 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -756,9 +756,9 @@ private: _Target_type() const noexcept override { #if _HAS_STATIC_RTTI return typeid(_Callable); -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI ^^^ / vvv !_HAS_STATIC_RTTI vvv _CSTD abort(); -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ } const void* _Get() const noexcept override { @@ -821,9 +821,9 @@ private: _Target_type() const noexcept override { #if _HAS_STATIC_RTTI return typeid(_Callable); -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI ^^^ / vvv !_HAS_STATIC_RTTI vvv _CSTD abort(); -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ } const void* _Get() const noexcept override { @@ -1125,7 +1125,7 @@ public: return reinterpret_cast(this->_Target(typeid(_Fx))); } } -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI ^^^ / vvv !_HAS_STATIC_RTTI vvv const type_info& target_type() const noexcept = delete; // requires static RTTI template @@ -1133,7 +1133,7 @@ public: template const _Fx* target() const noexcept = delete; // requires static RTTI -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ }; #if _HAS_CXX17 diff --git a/stl/inc/iosfwd b/stl/inc/iosfwd index e6aa40d5af..a8b715f43a 100644 --- a/stl/inc/iosfwd +++ b/stl/inc/iosfwd @@ -37,11 +37,11 @@ _STD_BEGIN .setstate(xtype::badbit, true); /* set badbit and rethrow */ \ _CATCH_END -#else // _HAS_EXCEPTIONS +#else // ^^^ _HAS_EXCEPTIONS ^^^ / vvv !_HAS_EXCEPTIONS vvv #define _TRY_IO_BEGIN { // begin try block #define _CATCH_IO_END } // catch block for _Myios #define _CATCH_IO_(xtype, x) } // catch block for basic_ios x -#endif // _HAS_EXCEPTIONS +#endif // ^^^!_HAS_EXCEPTIONS ^^^ // from _EXPORT_STD using streamoff = long long; diff --git a/stl/inc/iostream b/stl/inc/iostream index efa221eb4f..21383ad23f 100644 --- a/stl/inc/iostream +++ b/stl/inc/iostream @@ -35,7 +35,7 @@ __PURE_APPDOMAIN_GLOBAL extern wistream* _Ptr_wcin; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcout; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcerr; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wclog; -#else // _M_CEE_PURE +#else // ^^^ _M_CEE_PURE ^^^ / vvv !_M_CEE_PURE vvv _EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT istream cin; _EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream cout; _EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream cerr; @@ -65,7 +65,7 @@ private: }; #endif // _CRTBLD -#endif // _M_CEE_PURE +#endif // ^^^ !_M_CEE_PURE ^^^ _STD_END #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/istream b/stl/inc/istream index ad814f1554..fa7b2342cf 100644 --- a/stl/inc/istream +++ b/stl/inc/istream @@ -840,7 +840,7 @@ basic_istream& operator>>( return _Istream_extract_into_buffer(_Istr, _Size, reinterpret_cast(_Str)); } #pragma warning(pop) -#else // _HAS_CXX20 +#else // ^^^_HAS_CXX20 ^^^ / vvv !_HAS_CXX20 vvv template basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, _Elem* _Str) { return _Istream_extract_into_buffer(_Istr, SIZE_MAX, _Str); diff --git a/stl/inc/list b/stl/inc/list index b8f816ab18..c2bfaf0274 100644 --- a/stl/inc/list +++ b/stl/inc/list @@ -1681,9 +1681,9 @@ public: #if _HAS_CXX20 return _Oldsize - _My_data._Mysize; -#else // _HAS_CXX20 +#else (void) _Oldsize; -#endif // _HAS_CXX20 +#endif } auto unique() { // erase each element matching previous @@ -1708,9 +1708,9 @@ public: #if _HAS_CXX20 return _Oldsize - _Mypair._Myval2._Mysize; -#else // _HAS_CXX20 +#else (void) _Oldsize; -#endif // _HAS_CXX20 +#endif } void merge(list& _Right) { // merge in elements from _Right, both ordered by operator< diff --git a/stl/inc/memory b/stl/inc/memory index 9e0613a3cb..e7498abe08 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -1229,9 +1229,9 @@ public: if (_Typeid == typeid(_Dx)) { return const_cast<_Dx*>(_STD addressof(_Mypair._Get_first())); } -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI ^^^ / vvv !_HAS_STATIC_RTTI vvv (void) _Typeid; -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ return nullptr; } @@ -1263,9 +1263,9 @@ public: if (_Typeid == typeid(_Dx)) { return const_cast<_Dx*>(_STD addressof(_Mypair._Get_first())); } -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI ^^^ / vvv !_HAS_STATIC_RTTI vvv (void) _Typeid; -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ return nullptr; } @@ -2052,12 +2052,12 @@ _NODISCARD shared_ptr<_Ty1> dynamic_pointer_cast(shared_ptr<_Ty2>&& _Other) noex return {}; } -#else // _CPPRTTI +#else // ^^^ _CPPRTTI ^^^ / vvv !_CPPRTTI vvv _EXPORT_STD template shared_ptr<_Ty1> dynamic_pointer_cast(const shared_ptr<_Ty2>&) noexcept = delete; // requires /GR option _EXPORT_STD template shared_ptr<_Ty1> dynamic_pointer_cast(shared_ptr<_Ty2>&&) noexcept = delete; // requires /GR option -#endif // _CPPRTTI +#endif // ^^^ _CPPRTTI ^^^ #if _HAS_STATIC_RTTI _EXPORT_STD template @@ -2069,10 +2069,10 @@ _NODISCARD _Dx* get_deleter(const shared_ptr<_Ty>& _Sx) noexcept { return nullptr; } -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI ^^^ / vvv !_HAS_STATIC_RTTI vvv _EXPORT_STD template _Dx* get_deleter(const shared_ptr<_Ty>&) noexcept = delete; // requires static RTTI -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ #if _HAS_CXX20 struct _For_overwrite_tag { @@ -2763,9 +2763,9 @@ _EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC #if _HAS_CXX20 enable_if_t, shared_ptr<_Ty>> -#else // _HAS_CXX20 +#else shared_ptr<_Ty> -#endif // _HAS_CXX20 +#endif make_shared(_Types&&... _Args) { // make a shared_ptr to non-array object const auto _Rx = new _Ref_count_obj2<_Ty>(_STD forward<_Types>(_Args)...); shared_ptr<_Ty> _Ret; @@ -2858,9 +2858,9 @@ _EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC #if _HAS_CXX20 enable_if_t, shared_ptr<_Ty>> -#else // _HAS_CXX20 +#else shared_ptr<_Ty> -#endif // _HAS_CXX20 +#endif allocate_shared(const _Alloc& _Al, _Types&&... _Args) { // make a shared_ptr to non-array object // Note: As of 2019-05-28, this implements the proposed resolution of LWG-3210 (which controls whether // allocator::construct sees T or const T when _Ty is const qualified) @@ -3027,9 +3027,9 @@ public: weak_ptr(const weak_ptr<_Ty2>& _Other) noexcept { #ifdef _M_CEE_PURE constexpr bool _Avoid_expired_conversions = true; // slow, but always safe; avoids error LNK1179 -#else // _M_CEE_PURE +#else constexpr bool _Avoid_expired_conversions = _Must_avoid_expired_conversions_from<_Ty2>; -#endif // _M_CEE_PURE +#endif if constexpr (_Avoid_expired_conversions) { this->_Weakly_convert_lvalue_avoiding_expired_conversions(_Other); @@ -3046,9 +3046,9 @@ public: weak_ptr(weak_ptr<_Ty2>&& _Other) noexcept { #ifdef _M_CEE_PURE constexpr bool _Avoid_expired_conversions = true; // slow, but always safe; avoids error LNK1179 -#else // _M_CEE_PURE +#else constexpr bool _Avoid_expired_conversions = _Must_avoid_expired_conversions_from<_Ty2>; -#endif // _M_CEE_PURE +#endif if constexpr (_Avoid_expired_conversions) { this->_Weakly_convert_rvalue_avoiding_expired_conversions(_STD move(_Other)); diff --git a/stl/inc/ostream b/stl/inc/ostream index beef34bae1..ebe5578e1b 100644 --- a/stl/inc/ostream +++ b/stl/inc/ostream @@ -1067,14 +1067,14 @@ basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>& _Ostr) } return _Ostr; } -#else // _CPPRTTI +#else // ^^^ _CPPRTTI ^^^ / vvv !_CPPRTTI vvv _EXPORT_STD template basic_ostream<_Elem, _Traits>& emit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option _EXPORT_STD template basic_ostream<_Elem, _Traits>& noemit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option _EXPORT_STD template basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option -#endif // _CPPRTTI +#endif // ^^^ !_CPPRTTI ^^^ #endif // _HAS_CXX20 _EXPORT_STD template diff --git a/stl/inc/random b/stl/inc/random index d892acd566..a48baf7616 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -2170,9 +2170,9 @@ _NODISCARD _Flt _Float_upper_bound(_Ty _Val) { #ifdef _M_CEE_PURE constexpr auto _Ty_32or64_digits = numeric_limits<_Ty_32or64>::digits; const auto _Log_plus1 = _Ty_32or64_digits - _Countl_zero_internal(static_cast<_Ty_32or64>(_Val | _Ty{1})); -#else // _M_CEE_PURE +#else // ^^^ _M_CEE_PURE ^^^ / vvv !_CPPRTTI vvv const auto _Log_plus1 = _Bit_scan_reverse(static_cast<_Ty_32or64>(_Val | _Ty{1})); -#endif // _M_CEE_PURE +#endif // ^^^ !_M_CEE_PURE ^^^ const auto _Shifted_mask = _Mask >> (_Ty_digits - _Log_plus1); const auto _Ceil_ulp = _Shifted_mask & -_Shifted_mask; _Val &= _Shifted_mask; diff --git a/stl/inc/regex b/stl/inc/regex index a370a56c0b..25290396a4 100644 --- a/stl/inc/regex +++ b/stl/inc/regex @@ -41,19 +41,17 @@ _STL_DISABLE_CLANG_WARNINGS #ifndef _REGEX_MAX_STACK_COUNT #ifdef _WIN64 #define _REGEX_MAX_STACK_COUNT 600L // set to 0 to disable -#else // _WIN64 +#else #define _REGEX_MAX_STACK_COUNT 1000L // set to 0 to disable -#endif // _WIN64 +#endif #endif // _REGEX_MAX_STACK_COUNT #ifndef _ENHANCED_REGEX_VISUALIZER - #ifdef _DEBUG #define _ENHANCED_REGEX_VISUALIZER 1 - -#else // _DEBUG +#else #define _ENHANCED_REGEX_VISUALIZER 0 -#endif // _DEBUG +#endif #endif // _ENHANCED_REGEX_VISUALIZER _STD_BEGIN @@ -1872,9 +1870,9 @@ public: basic_regex(const basic_regex& _Right) #if _ENHANCED_REGEX_VISUALIZER : _Rep(nullptr), _Traits(_Right._Traits), _Visualization(_Right._Visualization) -#else // _ENHANCED_REGEX_VISUALIZER +#else : _Rep(nullptr), _Traits(_Right._Traits) -#endif // _ENHANCED_REGEX_VISUALIZER +#endif { // construct copy of _Right _Reset(_Right._Rep); } diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 529563cccd..ae4edf2369 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -378,10 +378,9 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #ifdef _M_CEE #define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__clrcall, OPT1, OPT2, OPT3) - -#else // _M_CEE +#else // ^^^_M_CEE ^^^ / vvv !_M_CEE vvv #define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3) -#endif // _M_CEE +#endif // ^^^ !_M_CEE ^^^ #if defined(_M_IX86) && !defined(_M_CEE) #define _EMIT_FASTCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__fastcall, OPT1, OPT2, OPT3) @@ -393,11 +392,10 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #ifdef _M_IX86 #define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__stdcall, OPT1, OPT2, OPT3) #define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__thiscall, OPT1, OPT2, OPT3) - -#else // _M_IX86 +#else // ^^^ !_M_IX86 ^^^ / vvv _M_CEE vvv #define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) #define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) -#endif // _M_IX86 +#endif // ^^^ !_M_IX86 ^^^ #if ((defined(_M_IX86) && _M_IX86_FP >= 2) || defined(_M_X64)) && !defined(_M_CEE) #define _EMIT_VECTORCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__vectorcall, OPT1, OPT2, OPT3) @@ -428,9 +426,9 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \ _NON_MEMBER_CALL_CV_REF(FUNC, ) \ _NON_MEMBER_CALL_CV_REF(FUNC, noexcept) -#else // __cpp_noexcept_function_type +#else // ^^^ __cpp_noexcept_function_type ^^^ / vvv !__cpp_noexcept_function_type vvv #define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _NON_MEMBER_CALL_CV_REF(FUNC, ) -#endif // __cpp_noexcept_function_type +#endif // ^^^ !__cpp_noexcept_function_type ^^^ #define _MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ _EMIT_CDECL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ @@ -455,9 +453,9 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \ _MEMBER_CALL_CV_REF(FUNC, ) \ _MEMBER_CALL_CV_REF(FUNC, noexcept) -#else // __cpp_noexcept_function_type +#else // ^^^ __cpp_noexcept_function_type ^^^ / vvv !__cpp_noexcept_function_type vvv #define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _MEMBER_CALL_CV_REF(FUNC, ) -#endif // __cpp_noexcept_function_type +#endif // ^^^ !__cpp_noexcept_function_type ^^^ #ifdef __cpp_noexcept_function_type #define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \ @@ -485,7 +483,7 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; CLASS(const&& noexcept) \ CLASS(volatile&& noexcept) \ CLASS(const volatile&& noexcept) -#else // __cpp_noexcept_function_type +#else // ^^^ __cpp_noexcept_function_type ^^^ / vvv !__cpp_noexcept_function_type vvv #define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \ CLASS(_EMPTY_ARGUMENT) \ CLASS(const) \ @@ -499,7 +497,7 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; CLASS(const&&) \ CLASS(volatile&&) \ CLASS(const volatile&&) -#endif // __cpp_noexcept_function_type +#endif // ^^^ !__cpp_noexcept_function_type ^^^ template struct _Arg_types {}; // provide argument_type, etc. when sizeof...(_Types) is 1 or 2 diff --git a/stl/inc/utility b/stl/inc/utility index f853436f79..13b48be3e8 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -906,13 +906,13 @@ using _With_reference = _Ty&; template concept _Can_reference = requires { typename _With_reference<_Ty>; }; -#else // __cpp_lib_concepts +#else // ^^^__cpp_lib_concepts ^^^ / vvv !__cpp_lib_concepts vvv template inline constexpr bool _Can_reference = false; template inline constexpr bool _Can_reference<_Ty, void_t<_Ty&>> = true; -#endif // __cpp_lib_concepts +#endif // ^^^__cpp_lib_concepts ^^^ #endif // _HAS_CXX20 #if _HAS_CXX23 diff --git a/stl/inc/variant b/stl/inc/variant index 2dc66b9b87..0f5a596899 100644 --- a/stl/inc/variant +++ b/stl/inc/variant @@ -916,10 +916,10 @@ struct _Variant_init_single_overload { #if _HAS_CXX20 template auto operator()(_TargetType, _InitializerType&&) -> _Variant_type_resolver<_Idx, _TargetType, _InitializerType>; -#else // _HAS_CXX20 +#else // ^^^_HAS_CXX20 ^^^ / vvv !_HAS_CXX20 vvv template auto operator()(_TargetType, _InitializerType&&) -> _Meta_list, _TargetType>; -#endif // _HAS_CXX20 +#endif // ^^^ !_HAS_CXX20 ^^^ }; template diff --git a/stl/inc/vector b/stl/inc/vector index c6552845a3..9776ae2580 100644 --- a/stl/inc/vector +++ b/stl/inc/vector @@ -2644,9 +2644,9 @@ public: // test for compatible iterator pair #if _ITERATOR_DEBUG_LEVEL == 0 (void) _Right; -#else // _ITERATOR_DEBUG_LEVEL == 0 +#else _STL_VERIFY(this->_Getcont() == _Right._Getcont(), "vector iterators incompatible"); -#endif // _ITERATOR_DEBUG_LEVEL +#endif } #if _ITERATOR_DEBUG_LEVEL != 0 @@ -3407,9 +3407,9 @@ public: _STD copy(_Next_iter(_Where), end(), _Where); _Orphan_range(static_cast(_Off), this->_Mysize); -#else // _ITERATOR_DEBUG_LEVEL == 2 +#else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 ^^^ / vvv _ITERATOR_DEBUG_LEVEL < 2 vvv _STD copy(_Next_iter(_Where), end(), _Where); -#endif // _ITERATOR_DEBUG_LEVEL == 2 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ _Trim(this->_Mysize - 1); return begin() + _Off; @@ -3429,10 +3429,10 @@ public: _Orphan_range(_Newsize, this->_Mysize); _Trim(_Newsize); -#else // _ITERATOR_DEBUG_LEVEL == 2 +#else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 ^^^ / vvv _ITERATOR_DEBUG_LEVEL < 2 vvv iterator _Next = _STD copy(_Last, end(), _First); _Trim(static_cast(_Next - begin())); -#endif // _ITERATOR_DEBUG_LEVEL == 2 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ } return begin() + _Off; } diff --git a/stl/inc/xatomic.h b/stl/inc/xatomic.h index aceaadf820..4f4e2541a0 100644 --- a/stl/inc/xatomic.h +++ b/stl/inc/xatomic.h @@ -90,7 +90,7 @@ _EXPORT_STD inline constexpr memory_order memory_order_acquire = memory_order::a _EXPORT_STD inline constexpr memory_order memory_order_release = memory_order::release; _EXPORT_STD inline constexpr memory_order memory_order_acq_rel = memory_order::acq_rel; _EXPORT_STD inline constexpr memory_order memory_order_seq_cst = memory_order::seq_cst; -#else // _HAS_CXX20 +#else // ^^^ _HAS_CXX20 ^^^ / vvv !_HAS_CXX20 vvv enum memory_order { memory_order_relaxed, memory_order_consume, @@ -99,7 +99,7 @@ enum memory_order { memory_order_acq_rel, memory_order_seq_cst }; -#endif // _HAS_CXX20 +#endif // ^^^ _HAS_CXX20 ^^^ using _Atomic_counter_t = unsigned long; diff --git a/stl/inc/xhash b/stl/inc/xhash index 6ca7a2a0f5..edc0d6b299 100644 --- a/stl/inc/xhash +++ b/stl/inc/xhash @@ -1941,9 +1941,9 @@ public: // a copy; otherwise, allow allocators that support only homogeneous compare. #ifdef _USE_HETEROGENEOUS_ALLOCATOR_COMPARE_IN_INTERNAL_CHECK _STL_INTERNAL_CHECK(_List._Getal() == _Vec._Mypair._Get_first()); -#else // _USE_HETEROGENEOUS_ALLOCATOR_COMPARE_IN_INTERNAL_CHECK +#else _STL_INTERNAL_CHECK(static_cast<_Aliter>(_List._Getal()) == _Vec._Mypair._Get_first()); -#endif // _USE_HETEROGENEOUS_ALLOCATOR_COMPARE_IN_INTERNAL_CHECK +#endif #ifdef _STL_INTERNAL_CHECK_EXHAUSTIVE size_type _Elements = 0; const auto _End = _Unchecked_end(); diff --git a/stl/inc/xlocale b/stl/inc/xlocale index 1a043c4c34..89dccdb690 100644 --- a/stl/inc/xlocale +++ b/stl/inc/xlocale @@ -445,9 +445,9 @@ const _Facet& __CRTDECL use_facet(const locale& _Loc) { // get facet reference f } else if (_Facet::_Getcat(&_Psave, &_Loc) == static_cast(-1)) { #if _HAS_EXCEPTIONS _Throw_bad_cast(); // lazy disallowed -#else // _HAS_EXCEPTIONS +#else _CSTD abort(); // lazy disallowed -#endif // _HAS_EXCEPTIONS +#endif } else { // queue up lazy facet for destruction auto _Pfmod = const_cast(_Psave); unique_ptr<_Facet_base> _Psave_guard(static_cast<_Facet_base*>(_Pfmod)); diff --git a/stl/inc/xlocinfo b/stl/inc/xlocinfo index 746407ce2a..abd8268823 100644 --- a/stl/inc/xlocinfo +++ b/stl/inc/xlocinfo @@ -54,10 +54,10 @@ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Getdateorder(); CallingConvention = System::Runtime::InteropServices::CallingConvention::Cdecl)] extern "C" int _Mbrtowc(_Out_opt_ wchar_t*, const char*, size_t, mbstate_t*, const _Cvtvec*); -#else // _M_CEE_PURE +#else // ^^^_M_CEE_PURE ^^^ / vvv !_M_CEE_PURE vvv _MRTIMP2 _Success_(return >= 0) int __cdecl _Mbrtowc( _When_(_Max_multibyte != 0, _Out_) wchar_t*, const char*, size_t _Max_multibyte, mbstate_t*, const _Cvtvec*); -#endif // _M_CEE_PURE +#endif // ^^^ !_M_CEE_PURE ^^^ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Strcoll(const char*, const char*, const char*, const char*, const _Collvec*); _CRTIMP2_PURE size_t __CLRCALL_PURE_OR_CDECL _Strxfrm(_Out_writes_(_End1 - _String1) @@ -163,9 +163,9 @@ public: #ifdef _DEBUG _Myptr = static_cast<_Elem*>(_malloc_dbg(_Count, _CRT_BLOCK, __FILE__, __LINE__)); -#else // _DEBUG +#else _Myptr = static_cast<_Elem*>(_CSTD malloc(_Count)); -#endif // _DEBUG +#endif if (_Myptr) { _CSTD memcpy(_Myptr, _Right, _Count); @@ -201,9 +201,9 @@ private: if (_Myptr) { #ifdef _DEBUG _free_dbg(_Myptr, _CRT_BLOCK); -#else // _DEBUG +#else _CSTD free(_Myptr); -#endif // _DEBUG +#endif } _Myptr = nullptr; @@ -372,9 +372,9 @@ public: private: #ifdef _M_CEE_PURE _EmptyLockit _Empty_lock; // to maintain same size -#else // _M_CEE_PURE +#else // ^^^ _M_CEE_PURE ^^^ / vvv !_M_CEE_PURE vvv _Lockit _Lock; // thread lock, because global locale is altered -#endif // _M_CEE_PURE +#endif // ^^^ _M_CEE_PURE ^^^ _Yarn _Days; // weekday names _Yarn _Months; // month names diff --git a/stl/inc/xmemory b/stl/inc/xmemory index 541258019c..f838212ccb 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -123,9 +123,9 @@ _STL_INTERNAL_STATIC_ASSERT(_Is_pow_2(_Big_allocation_alignment)); #ifdef _DEBUG _INLINE_VAR constexpr size_t _Non_user_size = 2 * sizeof(void*) + _Big_allocation_alignment - 1; -#else // _DEBUG +#else // ^^^ _DEBUG ^^^ / vvv !_DEBUG vvv _INLINE_VAR constexpr size_t _Non_user_size = sizeof(void*) + _Big_allocation_alignment - 1; -#endif // _DEBUG +#endif // ^^^ !_DEBUG ^^^ #ifdef _WIN64 _INLINE_VAR constexpr size_t _Big_allocation_sentinel = 0xFAFAFAFAFAFAFAFAULL; @@ -605,9 +605,9 @@ struct _Normal_allocator_traits { // defines traits for allocators if constexpr (_Uses_default_construct<_Alloc, _Ty*, _Types...>::value) { #if _HAS_CXX20 _STD construct_at(_Ptr, _STD forward<_Types>(_Args)...); -#else // _HAS_CXX20 +#else // ^^^ _HAS_CXX20 ^^^ / vvv !_HAS_CXX20 vvv ::new (static_cast(_Ptr)) _Ty(_STD forward<_Types>(_Args)...); -#endif // _HAS_CXX20 +#endif // ^^^ !_HAS_CXX20 ^^^ } else { _Al.construct(_Ptr, _STD forward<_Types>(_Args)...); } @@ -618,9 +618,9 @@ struct _Normal_allocator_traits { // defines traits for allocators if constexpr (_Uses_default_destroy<_Alloc, _Ty*>::value) { #if _HAS_CXX20 _STD destroy_at(_Ptr); -#else // _HAS_CXX20 +#else // ^^^ _HAS_CXX20 ^^^ / vvv !_HAS_CXX20 vvv _Ptr->~_Ty(); -#endif // _HAS_CXX20 +#endif // ^^^ !_HAS_CXX20 ^^^ } else { _Al.destroy(_Ptr); } @@ -729,9 +729,9 @@ struct _Default_allocator_traits { // traits for std::allocator static _CONSTEXPR20 void destroy(_Alloc&, _Uty* const _Ptr) { #if _HAS_CXX20 _STD destroy_at(_Ptr); -#else // _HAS_CXX20 +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv _Ptr->~_Uty(); -#endif // _HAS_CXX20 +#endif // ^^^ !_HAS_CXX20 ^^^ } _NODISCARD static _CONSTEXPR20 size_type max_size(const _Alloc&) noexcept { @@ -1423,10 +1423,10 @@ _CONSTEXPR20 void _Container_base12::_Swap_proxy_and_iterators(_Container_base12 #if _ITERATOR_DEBUG_LEVEL == 0 using _Container_base = _Container_base0; using _Iterator_base = _Iterator_base0; -#else // _ITERATOR_DEBUG_LEVEL == 0 +#else // ^^^ _ITERATOR_DEBUG_LEVEL == 0 ^^^ / vvv _ITERATOR_DEBUG_LEVEL > 0 vvv using _Container_base = _Container_base12; using _Iterator_base = _Iterator_base12; -#endif // _ITERATOR_DEBUG_LEVEL == 0 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL > 0 ^^^ struct _Leave_proxy_unbound { explicit _Leave_proxy_unbound() = default; @@ -1493,11 +1493,11 @@ _INLINE_VAR constexpr _Fake_allocator _Fake_alloc{}; #define _GET_PROXY_ALLOCATOR(_Alty, _Al) _Fake_alloc // TRANSITION, VSO-1284799, should be _Fake_allocator{} template using _Container_proxy_ptr = _Fake_proxy_ptr_impl; -#else // _ITERATOR_DEBUG_LEVEL == 0 +#else // ^^^ _ITERATOR_DEBUG_LEVEL == 0 ^^^ / vvv _ITERATOR_DEBUG_LEVEL > 0 vvv #define _GET_PROXY_ALLOCATOR(_Alty, _Al) static_cast<_Rebind_alloc_t<_Alty, _Container_proxy>>(_Al) template using _Container_proxy_ptr = _Container_proxy_ptr12<_Rebind_alloc_t<_Alloc, _Container_proxy>>; -#endif // _ITERATOR_DEBUG_LEVEL == 0 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL > 0 ^^^ struct _Zero_then_variadic_args_t { explicit _Zero_then_variadic_args_t() = default; diff --git a/stl/inc/xstring b/stl/inc/xstring index 455e6ae8f1..3d2d1b0174 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -248,10 +248,10 @@ public: } else { return _Primary_char_traits::compare(_First1, _First2, _Count); } -#else // _HAS_CXX17 +#else // ^^^ _HAS_CXX17 ^^^ / vvv !_HAS_CXX17 vvv return _CSTD wmemcmp( reinterpret_cast(_First1), reinterpret_cast(_First2), _Count); -#endif // _HAS_CXX17 +#endif // ^^^ !_HAS_CXX17 ^^^ } _NODISCARD static _CONSTEXPR17 size_t length(_In_z_ const _Elem* _First) noexcept /* strengthened */ { @@ -262,9 +262,9 @@ public: } else { return _Primary_char_traits::length(_First); } -#else // _HAS_CXX17 +#else // ^^^ _HAS_CXX17 ^^^ / vvv !_HAS_CXX17 vvv return _CSTD wcslen(reinterpret_cast(_First)); -#endif // _HAS_CXX17 +#endif // ^^^ !_HAS_CXX17 ^^^ } _NODISCARD static _CONSTEXPR17 const _Elem* find( @@ -276,9 +276,9 @@ public: } else { return _Primary_char_traits::find(_First, _Count, _Ch); } -#else // _HAS_CXX17 +#else // ^^^ _HAS_CXX17 ^^^ / vvv !_HAS_CXX17 vvv return reinterpret_cast(_CSTD wmemchr(reinterpret_cast(_First), _Ch, _Count)); -#endif // _HAS_CXX17 +#endif // ^^^ !_HAS_CXX17 ^^^ } static _CONSTEXPR20 _Elem* assign( @@ -379,9 +379,9 @@ public: // compare [_First1, _First1 + _Count) with [_First2, ...) #if _HAS_CXX17 return __builtin_memcmp(_First1, _First2, _Count); -#else // _HAS_CXX17 +#else // ^^^ _HAS_CXX17 ^^^ / vvv !_HAS_CXX17 vvv return _CSTD memcmp(_First1, _First2, _Count); -#endif // _HAS_CXX17 +#endif // ^^^ !_HAS_CXX17 ^^^ } _NODISCARD static _CONSTEXPR17 size_t length(_In_z_ const _Elem* const _First) noexcept /* strengthened */ { @@ -399,9 +399,9 @@ public: { return __builtin_strlen(_First); } -#else // _HAS_CXX17 +#else // ^^^ _HAS_CXX17 ^^^ / vvv !_HAS_CXX17 vvv return _CSTD strlen(reinterpret_cast(_First)); -#endif // _HAS_CXX17 +#endif // ^^^ !_HAS_CXX17 ^^^ } _NODISCARD static _CONSTEXPR17 const _Elem* find(_In_reads_(_Count) const _Elem* const _First, const size_t _Count, @@ -420,9 +420,9 @@ public: { return __builtin_char_memchr(_First, _Ch, _Count); } -#else // _HAS_CXX17 +#else // ^^^ _HAS_CXX17 ^^^ / vvv !_HAS_CXX17 vvv return static_cast(_CSTD memchr(_First, _Ch, _Count)); -#endif // _HAS_CXX17 +#endif // ^^^ !_HAS_CXX17 ^^^ } static _CONSTEXPR20 _Elem* assign( @@ -4207,7 +4207,7 @@ public: _Become_small(); } } -#else // _HAS_CXX20 +#else // ^^^ _HAS_CXX20 ^^^ / vvv !_HAS_CXX20 vvv void reserve(_CRT_GUARDOVERFLOW const size_type _Newcap = 0) { // determine new minimum length of allocated storage if (_Mypair._Myval2._Mysize > _Newcap) { // requested capacity is not large enough for current size, ignore return; // nothing to do @@ -4236,7 +4236,7 @@ public: // ignore requests to reserve to [_BUF_SIZE, _Myres) } -#endif // _HAS_CXX20 +#endif // ^^^ !_HAS_CXX20 ^^^ _NODISCARD_EMPTY_MEMBER _CONSTEXPR20 bool empty() const noexcept { return _Mypair._Myval2._Mysize == 0; @@ -4578,9 +4578,9 @@ public: _NODISCARD _CONSTEXPR20 basic_string substr(const size_type _Off = 0, const size_type _Count = npos) #if _HAS_CXX23 const& -#else // _HAS_CXX23 +#else const -#endif // _HAS_CXX23 +#endif { // return [_Off, _Off + _Count) as new string, default-constructing its allocator return basic_string{*this, _Off, _Count}; diff --git a/stl/inc/xthreads.h b/stl/inc/xthreads.h index 36a5d1bfde..2f9668f53f 100644 --- a/stl/inc/xthreads.h +++ b/stl/inc/xthreads.h @@ -37,16 +37,16 @@ struct _Mtx_internal_imp_t { #ifdef _CRT_WINDOWS #ifdef _WIN64 static constexpr size_t _Critical_section_size = 16; -#else // _WIN64 +#else // ^^^_WIN64 ^^^ / vvv !_WIN64 vvv static constexpr size_t _Critical_section_size = 8; -#endif // _WIN64 -#else // _CRT_WINDOWS +#endif // ^^^ !_WIN64 ^^^ +#else // ^^^_CRT_WINDOWS ^^^ / vvv !_CRT_WINDOWS vvv #ifdef _WIN64 static constexpr size_t _Critical_section_size = 64; -#else // _WIN64 +#else // ^^^_WIN64 ^^^ / vvv !_WIN64 vvv static constexpr size_t _Critical_section_size = 36; -#endif // _WIN64 -#endif // _CRT_WINDOWS +#endif // ^^^ !_WIN64 ^^^ +#endif // ^^^ !_CRT_WINDOWS ^^^ static constexpr size_t _Critical_section_align = alignof(void*); @@ -64,19 +64,19 @@ struct _Mtx_internal_imp_t { #ifdef _WIN64 _INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 16; _INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 8; -#else // _WIN64 +#else // ^^^_WIN64 ^^^ / vvv !_WIN64 vvv _INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 8; _INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 4; -#endif // _WIN64 -#else // _CRT_WINDOWS +#endif // ^^^ !_WIN64 ^^^ +#else // ^^^_CRT_WINDOWS ^^^ / vvv !_CRT_WINDOWS vvv #ifdef _WIN64 _INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 72; _INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 8; -#else // _WIN64 +#else // ^^^_WIN64 ^^^ / vvv !_WIN64 vvv _INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 40; _INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 4; -#endif // _WIN64 -#endif // _CRT_WINDOWS +#endif // ^^^ !_WIN64 ^^^ +#endif // ^^^ !_CRT_WINDOWS ^^^ using _Mtx_t = _Mtx_internal_imp_t*; diff --git a/stl/inc/xutility b/stl/inc/xutility index 60ea3b5a3e..7f4c8e7489 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -1358,7 +1358,7 @@ using _Unwrap_enum_t = typename _Unwrap_enum<_Elem>::type; #define _DEBUG_ORDER_UNWRAPPED(first, last, pred) #define _DEBUG_ORDER_SET_UNWRAPPED(otherIter, first, last, pred) -#else // _ITERATOR_DEBUG_LEVEL < 2 +#else // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ / vvv _ITERATOR_DEBUG_LEVEL == 2 vvv #define _DEBUG_LT_PRED(pred, x, y) _Debug_lt_pred(pred, x, y) #define _DEBUG_ORDER_UNWRAPPED(first, last, pred) _Debug_order_unchecked(first, last, pred) #define _DEBUG_ORDER_SET_UNWRAPPED(otherIter, first, last, pred) \ @@ -1403,7 +1403,7 @@ constexpr void _Debug_order_set_unchecked(_InIt _First, _InIt _Last, _Pr&& _Pred _Debug_order_unchecked(_First, _Last, _Pred); } } -#endif // _ITERATOR_DEBUG_LEVEL < 2 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL == 2 ^^^ // from _EXPORT_STD template diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index 438543e7f2..dc48f7e308 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -360,11 +360,11 @@ extern "C++" class _CRTIMP2_PURE_IMPORT _Lockit { // lock while object in existe _Lockit_dtor(this); } -#else // _M_CEE_PURE +#else // ^^^ _M_CEE_PURE ^^^ / vvv !_M_CEE_PURE vvv __thiscall _Lockit() noexcept; explicit __thiscall _Lockit(int) noexcept; // set the lock __thiscall ~_Lockit() noexcept; // clear the lock -#endif // _M_CEE_PURE +#endif // ^^^ _M_CEE_PURE ^^^ static void __cdecl _Lockit_ctor(int) noexcept; static void __cdecl _Lockit_dtor(int) noexcept; @@ -393,9 +393,9 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa #ifndef _PREPARE_CONSTRAINED_REGIONS #ifdef _M_CEE_PURE #define _PREPARE_CONSTRAINED_REGIONS 1 -#else // _M_CEE_PURE +#else #define _PREPARE_CONSTRAINED_REGIONS 0 -#endif // _M_CEE_PURE +#endif #endif // _PREPARE_CONSTRAINED_REGIONS #if _PREPARE_CONSTRAINED_REGIONS @@ -421,14 +421,14 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa } \ } -#else // _PREPARE_CONSTRAINED_REGIONS +#else // ^^^ _PREPARE_CONSTRAINED_REGIONS ^^^ / vvv !_PREPARE_CONSTRAINED_REGIONS vvv #define _BEGIN_LOCK(_Kind) \ { \ _STD _Lockit _Lock(_Kind); #define _END_LOCK() } -#endif // _PREPARE_CONSTRAINED_REGIONS +#endif // ^^^ !_PREPARE_CONSTRAINED_REGIONS ^^^ #define _BEGIN_LOCINFO(_VarName) \ _BEGIN_LOCK(_LOCK_LOCALE) \ @@ -436,7 +436,7 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa #define _END_LOCINFO() _END_LOCK() -#else // _M_CEE +#else // ^^^ _M_CEE ^^^ / vvv !_M_CEE vvv #define _BEGIN_LOCK(_Kind) \ { \ _STD _Lockit _Lock(_Kind); @@ -448,7 +448,7 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa _Locinfo _VarName; #define _END_LOCINFO() } -#endif // _M_CEE +#endif // ^^^ !_M_CEE ^^^ #ifdef _CRTBLD @@ -457,9 +457,9 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa [System::Runtime::ConstrainedExecution::ReliabilityContract( \ System::Runtime::ConstrainedExecution::Consistency::WillNotCorruptState, \ System::Runtime::ConstrainedExecution::Cer::Success)] -#else // _M_CEE +#else // ^^^ _M_CEE ^^^ / vvv !_M_CEE vvv #define _RELIABILITY_CONTRACT -#endif // _M_CEE +#endif // ^^^ !_M_CEE ^^^ #endif // _CRTBLD @@ -476,7 +476,7 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa #define _RERAISE throw #define _THROW(x) throw x -#else // _HAS_EXCEPTIONS +#else // ^^^ _HAS_EXCEPTIONS ^^^ / vvv !_HAS_EXCEPTIONS vvv #define _TRY_BEGIN \ { \ if (1) { @@ -492,13 +492,13 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa #ifdef _DEBUG #define _RAISE(x) _invoke_watson(_CRT_WIDE(#x), __FUNCTIONW__, __FILEW__, __LINE__, 0) -#else // _DEBUG +#else #define _RAISE(x) _invoke_watson(nullptr, nullptr, nullptr, 0, 0) -#endif // _DEBUG +#endif #define _RERAISE #define _THROW(x) x._Raise() -#endif // _HAS_EXCEPTIONS +#endif // ^^^ !_HAS_EXCEPTIONS ^^^ _STD_END #pragma pop_macro("new") diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index c0ee672319..1bde801542 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -749,23 +749,23 @@ // termination on exception is not guaranteed. Specify /EHsc (/Wall) #if _HAS_EXCEPTIONS #define _STL_DISABLED_WARNING_C4577 -#else // _HAS_EXCEPTIONS +#else #define _STL_DISABLED_WARNING_C4577 4577 -#endif // _HAS_EXCEPTIONS +#endif // warning C4984: 'if constexpr' is a C++17 language extension #if !_HAS_CXX17 #define _STL_DISABLED_WARNING_C4984 4984 -#else // !_HAS_CXX17 +#else #define _STL_DISABLED_WARNING_C4984 -#endif // !_HAS_CXX17 +#endif // warning C5053: support for 'explicit()' in C++17 and earlier is a vendor extension #if !_HAS_CXX20 #define _STL_DISABLED_WARNING_C5053 5053 -#else // !_HAS_CXX20 +#else #define _STL_DISABLED_WARNING_C5053 -#endif // !_HAS_CXX20 +#endif #ifndef _STL_EXTRA_DISABLED_WARNINGS #define _STL_EXTRA_DISABLED_WARNINGS @@ -829,17 +829,17 @@ _Pragma("clang diagnostic ignored \"-Wuser-defined-literals\"") \ _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") // clang-format on -#else // __clang__ +#else // ^^^ __clang__ ^^^ / vvv !__clang__ vvv #define _STL_DISABLE_CLANG_WARNINGS -#endif // __clang__ +#endif // ^^^ !__clang__ ^^^ #endif // _STL_DISABLE_CLANG_WARNINGS #ifndef _STL_RESTORE_CLANG_WARNINGS #ifdef __clang__ #define _STL_RESTORE_CLANG_WARNINGS _Pragma("clang diagnostic pop") -#else // __clang__ +#else // ^^^ __clang__ ^^^ / vvv !__clang__ vvv #define _STL_RESTORE_CLANG_WARNINGS -#endif // __clang__ +#endif // ^^^ !__clang__ ^^^ #endif // _STL_RESTORE_CLANG_WARNINGS // clang-format off @@ -936,9 +936,9 @@ _EMIT_STL_ERROR(STL1001, "Unexpected compiler version, expected MSVC 19.36 or ne // P0607R0 Inline Variables For The STL #if _HAS_CXX17 #define _INLINE_VAR inline -#else // _HAS_CXX17 +#else #define _INLINE_VAR -#endif // _HAS_CXX17 +#endif // N4190 Removing auto_ptr, random_shuffle(), And Old Stuff #ifndef _HAS_AUTO_PTR_ETC @@ -983,13 +983,13 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #if _HAS_TR1_NAMESPACE #ifdef _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING #define _DEPRECATE_TR1_NAMESPACE -#else // _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING +#else // ^^^ _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING ^^^ / vvv !_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING vvv #define _DEPRECATE_TR1_NAMESPACE \ [[deprecated( \ "warning STL4002: " \ "The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED. You can " \ "define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to suppress this warning.")]] -#endif // _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING +#endif // ^^^ !_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING ^^^ #endif // _HAS_TR1_NAMESPACE // STL4003 was "The non-Standard std::identity struct is deprecated and will be REMOVED." @@ -1844,9 +1844,9 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #define __cpp_lib_chrono 201907L // P1466R3 Miscellaneous Minor Fixes For #elif _HAS_CXX17 #define __cpp_lib_chrono 201611L // P0505R0 constexpr For (Again) -#else // _HAS_CXX17 +#else // ^^^ _HAS_CXX17 ^^^ / vvv !_HAS_CXX17 vvv #define __cpp_lib_chrono 201510L // P0092R1 floor(), ceil(), round(), abs() -#endif // _HAS_CXX17 +#endif // ^^^ !_HAS_CXX17 ^^^ #if _HAS_CXX23 #define __cpp_lib_constexpr_memory 202202L // P2273R3 constexpr unique_ptr @@ -1880,9 +1880,9 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #if _HAS_CXX20 #define __cpp_lib_shared_ptr_arrays 201707L // P0674R1 make_shared() For Arrays -#else // _HAS_CXX20 +#else #define __cpp_lib_shared_ptr_arrays 201611L // P0497R0 Fixing shared_ptr For Arrays -#endif // _HAS_CXX20 +#endif #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 #define __cpp_lib_shift 202202L // P2440R1 ranges::shift_left, ranges::shift_right From 06385133953364e7346850c2a415b25a13242ed7 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 11:13:12 +0300 Subject: [PATCH 02/36] delete unneeded file --- GitExtensions.settings | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 GitExtensions.settings diff --git a/GitExtensions.settings b/GitExtensions.settings deleted file mode 100644 index 684f9b0c2d..0000000000 --- a/GitExtensions.settings +++ /dev/null @@ -1,11 +0,0 @@ - - - - - 2ec3e1f0-ef37-413f-bea5-b8fe1f9c505c.OAuth Token - - - - - - \ No newline at end of file From 23c37e3972092b9a829db1c2a419f3d61a298b3c Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 11:23:08 +0300 Subject: [PATCH 03/36] copypasta typo --- stl/inc/type_traits | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index ae4edf2369..9414cf864e 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -392,7 +392,7 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #ifdef _M_IX86 #define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__stdcall, OPT1, OPT2, OPT3) #define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__thiscall, OPT1, OPT2, OPT3) -#else // ^^^ !_M_IX86 ^^^ / vvv _M_CEE vvv +#else // ^^^ _M_IX86 ^^^ / vvv !_M_IX86 vvv #define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) #define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) #endif // ^^^ !_M_IX86 ^^^ From e31f650af7dda42d8a1c5f9d6adc4cfc778c6d41 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 11:26:06 +0300 Subject: [PATCH 04/36] also defined --- stl/inc/type_traits | 4 ++-- stl/inc/xfacet | 4 ++-- stl/inc/xlocale | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 9414cf864e..419ff1e40b 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -2314,10 +2314,10 @@ _NODISCARD constexpr bool _Bitmask_includes_all(_Bitmask _Left, _Bitmask _Elemen #if defined(_WIN64) _INLINE_VAR constexpr size_t _FNV_offset_basis = 14695981039346656037ULL; _INLINE_VAR constexpr size_t _FNV_prime = 1099511628211ULL; -#else // defined(_WIN64) +#else // ^^^ defined(_WIN64) ^^^ / vvv !defined(_WIN64) vvv _INLINE_VAR constexpr size_t _FNV_offset_basis = 2166136261U; _INLINE_VAR constexpr size_t _FNV_prime = 16777619U; -#endif // defined(_WIN64) +#endif // ^^^ !defined(_WIN64) ^^^ _NODISCARD inline size_t _Fnv1a_append_bytes(size_t _Val, const unsigned char* const _First, const size_t _Count) noexcept { // accumulate range [_First, _First + _Count) into partial FNV-1a hash _Val diff --git a/stl/inc/xfacet b/stl/inc/xfacet index 6a0807d4ab..a2abd1e51c 100644 --- a/stl/inc/xfacet +++ b/stl/inc/xfacet @@ -35,9 +35,9 @@ public: #if defined(_M_CEE) void __CLRCALL_OR_CDECL _Facet_Register_m(_Facet_base*); -#else // defined(_M_CEE) +#else // ^^^ defined(_M_CEE) ^^^ / vvv !defined(_M_CEE) vvv extern "C++" void __CLRCALL_OR_CDECL _Facet_Register(_Facet_base*); -#endif // defined(_M_CEE) +#endif // ^^^ !defined(_M_CEE) ^^^ _STD_END #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/xlocale b/stl/inc/xlocale index 89dccdb690..f1d112ed64 100644 --- a/stl/inc/xlocale +++ b/stl/inc/xlocale @@ -454,9 +454,9 @@ const _Facet& __CRTDECL use_facet(const locale& _Loc) { // get facet reference f #if defined(_M_CEE) _Facet_Register_m(_Pfmod); -#else // defined(_M_CEE) +#else // ^^^ defined(_M_CEE) ^^^ / vvv !defined(_M_CEE) vvv _Facet_Register(_Pfmod); -#endif // defined(_M_CEE) +#endif // ^^^ !defined(_M_CEE) ^^^ _Pfmod->_Incref(); _Facetptr<_Facet>::_Psave = _Psave; From 6b9e0a32a305a52ffa1bdb8bb2c37e8e259413cd Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 11:36:09 +0300 Subject: [PATCH 05/36] missing defined(...) --- stl/inc/__msvc_bit_utils.hpp | 8 ++++---- stl/inc/exception | 4 ++-- stl/inc/iostream | 4 ++-- stl/inc/memory | 8 ++++---- stl/inc/ostream | 6 +++--- stl/inc/random | 4 ++-- stl/inc/xatomic.h | 4 ++-- stl/inc/xbit_ops.h | 4 ++-- stl/inc/xlocinfo | 4 ++-- stl/inc/yvals.h | 4 ++-- stl/inc/yvals_core.h | 4 ++-- stl/src/excptptr.cpp | 8 ++++---- stl/src/locale0.cpp | 2 +- 13 files changed, 32 insertions(+), 32 deletions(-) diff --git a/stl/inc/__msvc_bit_utils.hpp b/stl/inc/__msvc_bit_utils.hpp index 3af1de66a4..b913d4daa5 100644 --- a/stl/inc/__msvc_bit_utils.hpp +++ b/stl/inc/__msvc_bit_utils.hpp @@ -128,14 +128,14 @@ template _NODISCARD int _Checked_x86_x64_countl_zero(const _Ty _Val) noexcept { #ifdef __AVX2__ return _Countl_zero_lzcnt(_Val); -#else // ^^^ __AVX2__ ^^^ / vvv !__AVX2__ vvv +#else // ^^^ defined(__AVX2__) ^^^ / vvv !defined(__AVX2__) vvv const bool _Definitely_have_lzcnt = __isa_available >= _Stl_isa_available_avx2; if (_Definitely_have_lzcnt) { return _Countl_zero_lzcnt(_Val); } else { return _Countl_zero_bsr(_Val); } -#endif // ^^^ !__AVX2__ ^^^ +#endif // ^^^ !!defined(__AVX2__) ^^^ } #endif // defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) @@ -299,14 +299,14 @@ template _NODISCARD int _Checked_x86_x64_countr_zero(const _Ty _Val) noexcept { #ifdef __AVX2__ return _Countr_zero_tzcnt(_Val); -#else // ^^^ __AVX2__ ^^^ / vvv !__AVX2__ vvv +#else // ^^^ defined(__AVX2__) ^^^ / vvv !defined(__AVX2__) vvv const bool _Definitely_have_tzcnt = __isa_available >= _Stl_isa_available_avx2; if (_Definitely_have_tzcnt) { return _Countr_zero_tzcnt(_Val); } else { return _Countr_zero_bsf(_Val); } -#endif // ^^^ !__AVX2__ ^^^ +#endif // ^^^ !!defined(__AVX2__) ^^^ } #endif // _HAS_TZCNT_BSF_INTRINSICS diff --git a/stl/inc/exception b/stl/inc/exception index da37457613..c4aa6b6cf0 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -392,10 +392,10 @@ void rethrow_if_nested(const _Ty& _Arg) { } } } -#else // ^^^ _CPPRTTI ^^^ / vvv !_CPPRTTI vvv +#else // ^^^ defined(_CPPRTTI) ^^^ / vvv !defined(_CPPRTTI) vvv _EXPORT_STD template void rethrow_if_nested(const _Ty&) = delete; // requires /GR option -#endif // ^^^ !_CPPRTTI ^^^ +#endif // ^^^ !defined(_CPPRTTI) ^^^ _EXPORT_STD class bad_variant_access : public exception { // exception for visit of a valueless variant or get on a variant with index() != I diff --git a/stl/inc/iostream b/stl/inc/iostream index 21383ad23f..2d0fb25f32 100644 --- a/stl/inc/iostream +++ b/stl/inc/iostream @@ -35,7 +35,7 @@ __PURE_APPDOMAIN_GLOBAL extern wistream* _Ptr_wcin; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcout; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcerr; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wclog; -#else // ^^^ _M_CEE_PURE ^^^ / vvv !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv _EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT istream cin; _EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream cout; _EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream cerr; @@ -65,7 +65,7 @@ private: }; #endif // _CRTBLD -#endif // ^^^ !_M_CEE_PURE ^^^ +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ _STD_END #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/memory b/stl/inc/memory index e7498abe08..2ce7556cf3 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -1133,10 +1133,10 @@ private: virtual void _Delete_this() noexcept { _STD terminate(); } -#else // ^^^ _M_CEE_PURE / !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv virtual void _Destroy() noexcept = 0; // destroy managed resource virtual void _Delete_this() noexcept = 0; // destroy self -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) _Atomic_counter_t _Uses = 1; _Atomic_counter_t _Weaks = 1; @@ -2052,12 +2052,12 @@ _NODISCARD shared_ptr<_Ty1> dynamic_pointer_cast(shared_ptr<_Ty2>&& _Other) noex return {}; } -#else // ^^^ _CPPRTTI ^^^ / vvv !_CPPRTTI vvv +#else // ^^^ defined(_CPPRTTI) ^^^ / vvv !defined(_CPPRTTI) vvv _EXPORT_STD template shared_ptr<_Ty1> dynamic_pointer_cast(const shared_ptr<_Ty2>&) noexcept = delete; // requires /GR option _EXPORT_STD template shared_ptr<_Ty1> dynamic_pointer_cast(shared_ptr<_Ty2>&&) noexcept = delete; // requires /GR option -#endif // ^^^ _CPPRTTI ^^^ +#endif // ^^^ !defined(_CPPRTTI) ^^^ #if _HAS_STATIC_RTTI _EXPORT_STD template diff --git a/stl/inc/ostream b/stl/inc/ostream index ebe5578e1b..c727f5ab08 100644 --- a/stl/inc/ostream +++ b/stl/inc/ostream @@ -1067,14 +1067,14 @@ basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>& _Ostr) } return _Ostr; } -#else // ^^^ _CPPRTTI ^^^ / vvv !_CPPRTTI vvv +#else // ^^^ defined(_CPPRTTI) ^^^ / vvv !defined(_CPPRTTI) vvv _EXPORT_STD template basic_ostream<_Elem, _Traits>& emit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option _EXPORT_STD template basic_ostream<_Elem, _Traits>& noemit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option _EXPORT_STD template basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option -#endif // ^^^ !_CPPRTTI ^^^ +#endif // ^^^ !defined(_CPPRTTI) ^^^ #endif // _HAS_CXX20 _EXPORT_STD template @@ -1285,7 +1285,7 @@ void println(ostream&, format_string<_Types...>, _Types&&...) = delete; // requi _EXPORT_STD void vprint_unicode(ostream&, string_view, format_args) = delete; // requires /GR option _EXPORT_STD void vprint_nonunicode(ostream&, string_view, format_args) = delete; // requires /GR option -#endif // !_CPPRTTI +#endif // ^^^ !defined(_CPPRTTI) ^^^ #endif // __cpp_lib_print _STD_END diff --git a/stl/inc/random b/stl/inc/random index a48baf7616..085c0939dc 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -2170,9 +2170,9 @@ _NODISCARD _Flt _Float_upper_bound(_Ty _Val) { #ifdef _M_CEE_PURE constexpr auto _Ty_32or64_digits = numeric_limits<_Ty_32or64>::digits; const auto _Log_plus1 = _Ty_32or64_digits - _Countl_zero_internal(static_cast<_Ty_32or64>(_Val | _Ty{1})); -#else // ^^^ _M_CEE_PURE ^^^ / vvv !_CPPRTTI vvv +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv const auto _Log_plus1 = _Bit_scan_reverse(static_cast<_Ty_32or64>(_Val | _Ty{1})); -#endif // ^^^ !_M_CEE_PURE ^^^ +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ const auto _Shifted_mask = _Mask >> (_Ty_digits - _Log_plus1); const auto _Ceil_ulp = _Shifted_mask & -_Shifted_mask; _Val &= _Shifted_mask; diff --git a/stl/inc/xatomic.h b/stl/inc/xatomic.h index 4f4e2541a0..3efe4e43e0 100644 --- a/stl/inc/xatomic.h +++ b/stl/inc/xatomic.h @@ -31,9 +31,9 @@ _STL_DISABLE_CLANG_WARNINGS #define _INTRIN_ACQ_REL(x) x #ifdef _M_CEE_PURE #define _YIELD_PROCESSOR() -#else // ^^^ _M_CEE_PURE / !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv #define _YIELD_PROCESSOR() _mm_pause() -#endif // ^^^ !_M_CEE_PURE ^^^ +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ #elif defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) #define _INTRIN_RELAXED(x) _CONCAT(x, _nf) diff --git a/stl/inc/xbit_ops.h b/stl/inc/xbit_ops.h index 7461379236..2b48f001d8 100644 --- a/stl/inc/xbit_ops.h +++ b/stl/inc/xbit_ops.h @@ -37,13 +37,13 @@ _NODISCARD inline unsigned long _Floor_of_log_2(size_t _Value) noexcept { // ret --_Result; } -#else // ^^^ _M_CEE_PURE / !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv #ifdef _WIN64 _BitScanReverse64(&_Result, _Value); // lgtm [cpp/conditionallyuninitializedvariable] #else // ^^^ 64-bit / 32-bit vvv _BitScanReverse(&_Result, _Value); // lgtm [cpp/conditionallyuninitializedvariable] #endif // 64 vs. 32-bit -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) return _Result; } diff --git a/stl/inc/xlocinfo b/stl/inc/xlocinfo index abd8268823..1bd76bd3d3 100644 --- a/stl/inc/xlocinfo +++ b/stl/inc/xlocinfo @@ -54,10 +54,10 @@ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Getdateorder(); CallingConvention = System::Runtime::InteropServices::CallingConvention::Cdecl)] extern "C" int _Mbrtowc(_Out_opt_ wchar_t*, const char*, size_t, mbstate_t*, const _Cvtvec*); -#else // ^^^_M_CEE_PURE ^^^ / vvv !_M_CEE_PURE vvv +#else // ^^^defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv _MRTIMP2 _Success_(return >= 0) int __cdecl _Mbrtowc( _When_(_Max_multibyte != 0, _Out_) wchar_t*, const char*, size_t _Max_multibyte, mbstate_t*, const _Cvtvec*); -#endif // ^^^ !_M_CEE_PURE ^^^ +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Strcoll(const char*, const char*, const char*, const char*, const _Collvec*); _CRTIMP2_PURE size_t __CLRCALL_PURE_OR_CDECL _Strxfrm(_Out_writes_(_End1 - _String1) diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index dc48f7e308..edceb9d01f 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -360,11 +360,11 @@ extern "C++" class _CRTIMP2_PURE_IMPORT _Lockit { // lock while object in existe _Lockit_dtor(this); } -#else // ^^^ _M_CEE_PURE ^^^ / vvv !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv __thiscall _Lockit() noexcept; explicit __thiscall _Lockit(int) noexcept; // set the lock __thiscall ~_Lockit() noexcept; // clear the lock -#endif // ^^^ _M_CEE_PURE ^^^ +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ static void __cdecl _Lockit_ctor(int) noexcept; static void __cdecl _Lockit_dtor(int) noexcept; diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 1bde801542..a474e1d1cf 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1929,10 +1929,10 @@ compiler option, or define _ALLOW_RTCc_IN_STL to suppress this error. #ifdef _M_CEE_PURE #define _EXTERN_C_UNLESS_PURE #define _END_EXTERN_C_UNLESS_PURE -#else // ^^^ _M_CEE_PURE / !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv #define _EXTERN_C_UNLESS_PURE _EXTERN_C #define _END_EXTERN_C_UNLESS_PURE _END_EXTERN_C -#endif // _M_CEE_PURE +#endif // !defined(_M_CEE_PURE) #if defined(MRTDLL) && !defined(_CRTBLD) #error In yvals_core.h, defined(MRTDLL) implies defined(_CRTBLD); !defined(_CRTBLD) implies !defined(MRTDLL) diff --git a/stl/src/excptptr.cpp b/stl/src/excptptr.cpp index 75aeac6589..83269ce5af 100644 --- a/stl/src/excptptr.cpp +++ b/stl/src/excptptr.cpp @@ -177,15 +177,15 @@ namespace { if (_PType->properties & CT_HasVirtualBase) { #ifdef _M_CEE_PURE reinterpret_cast(_CopyFunc)(_Dest, _Adjusted, 1); -#else // ^^^ _M_CEE_PURE / !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv _CallMemberFunction2(_Dest, _CopyFunc, _Adjusted, 1); -#endif // _M_CEE_PURE +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ } else { #ifdef _M_CEE_PURE reinterpret_cast(_CopyFunc)(_Dest, _Adjusted); -#else // ^^^ _M_CEE_PURE / !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv _CallMemberFunction1(_Dest, _CopyFunc, _Adjusted); -#endif // _M_CEE_PURE +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ } } } // unnamed namespace diff --git a/stl/src/locale0.cpp b/stl/src/locale0.cpp index 42c67242c6..733c84450a 100644 --- a/stl/src/locale0.cpp +++ b/stl/src/locale0.cpp @@ -179,7 +179,7 @@ _MRTIMP2_PURE locale::_Locimp* __CLRCALL_PURE_OR_CDECL locale::_Init(bool _Do_in ::new (&classic_locale) locale{ptr}; #if defined(_M_CEE_PURE) locale::_Locimp::_Clocptr = ptr; -#else // ^^^ _M_CEE_PURE / !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv const auto mem = reinterpret_cast(&locale::_Locimp::_Clocptr); const auto as_bytes = reinterpret_cast(ptr); _Compiler_or_memory_barrier(); From 7536cff53006983005016e88f26c5e7453a77a38 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 11:42:31 +0300 Subject: [PATCH 06/36] More defined(...) --- stl/inc/execution | 4 ++-- stl/inc/type_traits | 4 ++-- stl/inc/xlocinfo | 4 ++-- stl/inc/yvals.h | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/stl/inc/execution b/stl/inc/execution index c4cb47e2ce..00ad7b8427 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -33,11 +33,11 @@ _EXTERN_C using __std_TP_WORK = void; using __std_TP_CALLBACK_INSTANCE = void; using __std_TP_CALLBACK_ENVIRON = void; -#else // ^^^ _M_CEE / !_M_CEE vvv +#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv struct __std_TP_WORK; // not defined struct __std_TP_CALLBACK_INSTANCE; // not defined struct __std_TP_CALLBACK_ENVIRON; // not defined -#endif // _M_CEE +#endif // ^^^ !defined(_M_CEE) ^^^ using __std_PTP_WORK = __std_TP_WORK*; using __std_PTP_CALLBACK_INSTANCE = __std_TP_CALLBACK_INSTANCE*; diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 419ff1e40b..085bdd7d2f 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -378,9 +378,9 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #ifdef _M_CEE #define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__clrcall, OPT1, OPT2, OPT3) -#else // ^^^_M_CEE ^^^ / vvv !_M_CEE vvv +#else // ^^^ defined(_M_CEE) ^^^ / vvv !defined(_M_CEE) vvv #define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3) -#endif // ^^^ !_M_CEE ^^^ +#endif // ^^^ !defined(_M_CEE) ^^^ #if defined(_M_IX86) && !defined(_M_CEE) #define _EMIT_FASTCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__fastcall, OPT1, OPT2, OPT3) diff --git a/stl/inc/xlocinfo b/stl/inc/xlocinfo index 1bd76bd3d3..a2cb573f40 100644 --- a/stl/inc/xlocinfo +++ b/stl/inc/xlocinfo @@ -372,9 +372,9 @@ public: private: #ifdef _M_CEE_PURE _EmptyLockit _Empty_lock; // to maintain same size -#else // ^^^ _M_CEE_PURE ^^^ / vvv !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv _Lockit _Lock; // thread lock, because global locale is altered -#endif // ^^^ _M_CEE_PURE ^^^ +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ _Yarn _Days; // weekday names _Yarn _Months; // month names diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index edceb9d01f..9f5f42ed77 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -436,7 +436,7 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa #define _END_LOCINFO() _END_LOCK() -#else // ^^^ _M_CEE ^^^ / vvv !_M_CEE vvv +#else // ^^^ defined(_M_CEE) ^^^ / vvv !defined(_M_CEE) vvv #define _BEGIN_LOCK(_Kind) \ { \ _STD _Lockit _Lock(_Kind); @@ -448,7 +448,7 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa _Locinfo _VarName; #define _END_LOCINFO() } -#endif // ^^^ !_M_CEE ^^^ +#endif // ^^^ !defined(_M_CEE) ^^^ #ifdef _CRTBLD @@ -457,9 +457,9 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa [System::Runtime::ConstrainedExecution::ReliabilityContract( \ System::Runtime::ConstrainedExecution::Consistency::WillNotCorruptState, \ System::Runtime::ConstrainedExecution::Cer::Success)] -#else // ^^^ _M_CEE ^^^ / vvv !_M_CEE vvv +#else // ^^^ defined(_M_CEE) ^^^ / vvv !defined(_M_CEE) vvv #define _RELIABILITY_CONTRACT -#endif // ^^^ !_M_CEE ^^^ +#endif // ^^^ !defined(_M_CEE) ^^^ #endif // _CRTBLD From 9c08d622877e919f3e88a37e95d7916564184d6a Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 11:43:55 +0300 Subject: [PATCH 07/36] -whitespace --- stl/inc/yvals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index 9f5f42ed77..a8dba5e7c9 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -393,7 +393,7 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa #ifndef _PREPARE_CONSTRAINED_REGIONS #ifdef _M_CEE_PURE #define _PREPARE_CONSTRAINED_REGIONS 1 -#else +#else #define _PREPARE_CONSTRAINED_REGIONS 0 #endif #endif // _PREPARE_CONSTRAINED_REGIONS From f2639108925f24519ba167caaf2e3448c84d6d7d Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 11:50:51 +0300 Subject: [PATCH 08/36] More defined(...) --- stl/inc/xmemory | 8 ++++---- stl/inc/xthreads.h | 24 ++++++++++++------------ stl/inc/yvals.h | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/stl/inc/xmemory b/stl/inc/xmemory index f838212ccb..ea6954491e 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -123,9 +123,9 @@ _STL_INTERNAL_STATIC_ASSERT(_Is_pow_2(_Big_allocation_alignment)); #ifdef _DEBUG _INLINE_VAR constexpr size_t _Non_user_size = 2 * sizeof(void*) + _Big_allocation_alignment - 1; -#else // ^^^ _DEBUG ^^^ / vvv !_DEBUG vvv +#else // ^^^ defined(_DEBUG) / !defined(_DEBUG) vvv _INLINE_VAR constexpr size_t _Non_user_size = sizeof(void*) + _Big_allocation_alignment - 1; -#endif // ^^^ !_DEBUG ^^^ +#endif // ^^^ !defined(_DEBUG) ^^^ #ifdef _WIN64 _INLINE_VAR constexpr size_t _Big_allocation_sentinel = 0xFAFAFAFAFAFAFAFAULL; @@ -167,9 +167,9 @@ inline void _Adjust_manually_vector_aligned(void*& _Ptr, size_t& _Bytes) { // in range [_Min_back_shift, _Non_user_size] #ifdef _DEBUG constexpr uintptr_t _Min_back_shift = 2 * sizeof(void*); -#else // ^^^ _DEBUG / !_DEBUG vvv +#else // ^^^ defined(_DEBUG) / !defined(_DEBUG) vvv constexpr uintptr_t _Min_back_shift = sizeof(void*); -#endif // _DEBUG +#endif // ^^^ !defined(_DEBUG) const uintptr_t _Back_shift = reinterpret_cast(_Ptr) - _Ptr_container; _STL_VERIFY(_Back_shift >= _Min_back_shift && _Back_shift <= _Non_user_size, "invalid argument"); _Ptr = reinterpret_cast(_Ptr_container); diff --git a/stl/inc/xthreads.h b/stl/inc/xthreads.h index 2f9668f53f..0418471e81 100644 --- a/stl/inc/xthreads.h +++ b/stl/inc/xthreads.h @@ -37,16 +37,16 @@ struct _Mtx_internal_imp_t { #ifdef _CRT_WINDOWS #ifdef _WIN64 static constexpr size_t _Critical_section_size = 16; -#else // ^^^_WIN64 ^^^ / vvv !_WIN64 vvv +#else // ^^^ defined(_WIN64) ^^^ / vvv !defined(_WIN64) vvv static constexpr size_t _Critical_section_size = 8; -#endif // ^^^ !_WIN64 ^^^ -#else // ^^^_CRT_WINDOWS ^^^ / vvv !_CRT_WINDOWS vvv +#endif // ^^^ !defined(_WIN64) ^^^ +#else // ^^^ defined(_CRT_WINDOWS) ^^^ / vvv !defined(_CRT_WINDOWS) vvv #ifdef _WIN64 static constexpr size_t _Critical_section_size = 64; -#else // ^^^_WIN64 ^^^ / vvv !_WIN64 vvv +#else // ^^^defined(_WIN64) ^^^ / vvv !defined(_WIN64) vvv static constexpr size_t _Critical_section_size = 36; -#endif // ^^^ !_WIN64 ^^^ -#endif // ^^^ !_CRT_WINDOWS ^^^ +#endif // ^^^ !defined(_WIN64) ^^^ +#endif // ^^^ !defined(_CRT_WINDOWS) ^^^ static constexpr size_t _Critical_section_align = alignof(void*); @@ -64,19 +64,19 @@ struct _Mtx_internal_imp_t { #ifdef _WIN64 _INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 16; _INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 8; -#else // ^^^_WIN64 ^^^ / vvv !_WIN64 vvv +#else // ^^^ defined(_WIN64) ^^^ / vvv !defined(_WIN64) vvv _INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 8; _INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 4; -#endif // ^^^ !_WIN64 ^^^ -#else // ^^^_CRT_WINDOWS ^^^ / vvv !_CRT_WINDOWS vvv +#endif // ^^^ !defined(_WIN64) ^^^ +#else // ^^^ defined(_CRT_WINDOWS) ^^^ / vvv !defined(_CRT_WINDOWS) vvv #ifdef _WIN64 _INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 72; _INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 8; -#else // ^^^_WIN64 ^^^ / vvv !_WIN64 vvv +#else // ^^^ defined(_WIN64) ^^^ / vvv !defined(_WIN64) vvv _INLINE_VAR constexpr size_t _Cnd_internal_imp_size = 40; _INLINE_VAR constexpr size_t _Cnd_internal_imp_alignment = 4; -#endif // ^^^ !_WIN64 ^^^ -#endif // ^^^ !_CRT_WINDOWS ^^^ +#endif // ^^^ !defined(_WIN64) ^^^ +#endif // ^^^ !defined(_CRT_WINDOWS) ^^^ using _Mtx_t = _Mtx_internal_imp_t*; diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index a8dba5e7c9..90e612d998 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -212,9 +212,9 @@ _STL_DISABLE_CLANG_WARNINGS #ifdef _DEBUG #define _STL_ASSERT(cond, mesg) _STL_VERIFY(cond, mesg) -#else // ^^^ _DEBUG / !_DEBUG vvv +#else // ^^^ defined(_DEBUG) / !defined(_DEBUG) vvv #define _STL_ASSERT(cond, mesg) _Analysis_assume_(cond) -#endif // _DEBUG +#endif // ^^^ !defined(_DEBUG) ^^^ #ifdef _ENABLE_STL_INTERNAL_CHECK #define _STL_INTERNAL_CHECK(...) _STL_VERIFY(__VA_ARGS__, "STL internal check: " #__VA_ARGS__) @@ -225,9 +225,9 @@ _STL_DISABLE_CLANG_WARNINGS #ifndef _ENABLE_ATOMIC_REF_ALIGNMENT_CHECK #ifdef _DEBUG #define _ENABLE_ATOMIC_REF_ALIGNMENT_CHECK 1 -#else // ^^^ _DEBUG / !_DEBUG vvv +#else // ^^^ defined(_DEBUG) / !defined(_DEBUG) vvv #define _ENABLE_ATOMIC_REF_ALIGNMENT_CHECK 0 -#endif // _DEBUG +#endif // ^^^ !defined(_DEBUG) ^^^ #endif // _ENABLE_ATOMIC_REF_ALIGNMENT_CHECK #if _ENABLE_ATOMIC_REF_ALIGNMENT_CHECK From 808a52d58278803c183b51a6982a3a135a48adb5 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 12:14:25 +0300 Subject: [PATCH 09/36] More defined(...) --- stl/inc/__msvc_bit_utils.hpp | 20 ++++++++++---------- stl/inc/atomic | 8 ++++---- stl/inc/execution | 4 ++-- stl/inc/type_traits | 16 ++++++++-------- stl/inc/xatomic.h | 2 +- stl/inc/xutility | 24 ++++++++++++------------ 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/stl/inc/__msvc_bit_utils.hpp b/stl/inc/__msvc_bit_utils.hpp index b913d4daa5..8b7a5cb5d9 100644 --- a/stl/inc/__msvc_bit_utils.hpp +++ b/stl/inc/__msvc_bit_utils.hpp @@ -89,9 +89,9 @@ _NODISCARD int _Countl_zero_lzcnt(const _Ty _Val) noexcept { } else { return _Countl_zero_lzcnt(_High); } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv return static_cast(__lzcnt64(_Val)); -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } } @@ -115,11 +115,11 @@ _NODISCARD int _Countl_zero_bsr(const _Ty _Val) noexcept { if (!_BitScanReverse(&_Result, _Low)) { return _Digits; } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv if (!_BitScanReverse64(&_Result, _Val)) { return _Digits; } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } return static_cast(_Digits - 1 - _Result); } @@ -251,9 +251,9 @@ _NODISCARD int _Countr_zero_tzcnt(const _Ty _Val) noexcept { } else { return static_cast(_TZCNT_U32(_Low)); } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv return static_cast(_TZCNT_U64(_Val)); -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } } @@ -286,11 +286,11 @@ _NODISCARD int _Countr_zero_bsf(const _Ty _Val) noexcept { } else { return static_cast(_Result + 32); } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv if (!_BitScanForward64(&_Result, _Val)) { return _Digits; } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } return static_cast(_Result); } @@ -329,9 +329,9 @@ _NODISCARD int _Unchecked_x86_x64_popcount(const _Ty _Val) noexcept { } else { #ifdef _M_IX86 return static_cast(__popcnt(_Val >> 32) + __popcnt(static_cast(_Val))); -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv return static_cast(__popcnt64(_Val)); -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } } diff --git a/stl/inc/atomic b/stl/inc/atomic index 394b9a1389..2c7d642e65 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -1136,7 +1136,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics return _Temp; } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv _TVal exchange(const _TVal _Value, const memory_order _Order = memory_order_seq_cst) noexcept { // exchange with given memory order long long _As_bytes; @@ -1144,7 +1144,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics _Atomic_address_as(_Storage), _Atomic_reinterpret_as(_Value)); return reinterpret_cast<_TVal&>(_As_bytes); } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ bool compare_exchange_strong(_TVal& _Expected, const _TVal _Desired, const memory_order _Order = memory_order_seq_cst) noexcept { // CAS with given memory order @@ -1614,7 +1614,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper return fetch_add(static_cast<_TVal>(-1)) - static_cast<_TVal>(1); } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv _TVal fetch_add(const _TVal _Operand, const memory_order _Order = memory_order_seq_cst) noexcept { long long _Result; _ATOMIC_CHOOSE_INTRINSIC(static_cast(_Order), _Result, _InterlockedExchangeAdd64, @@ -1664,7 +1664,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper _TVal operator--() noexcept { return static_cast<_TVal>(_InterlockedDecrement64(_Atomic_address_as(this->_Storage))); } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ }; #if 1 // TRANSITION, ABI diff --git a/stl/inc/execution b/stl/inc/execution index 00ad7b8427..c21b4de8db 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -2814,9 +2814,9 @@ inline size_t _Get_stable_sort_tree_height(const size_t _Count, const size_t _Hw const size_t _Log_ideal_chunks = _Floor_of_log_2(_Ideal_chunks); #ifdef _WIN64 constexpr size_t _Max_tree_height = 62; // to avoid ptrdiff_t overflow -#else // ^^^ _WIN64 / !_WIN64 vvv +#else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv constexpr size_t _Max_tree_height = 30; -#endif // _WIN64 +#endif // defined(_WIN64) const size_t _Clamped_ideal_chunks = (_STD min)(_Max_tree_height, _Log_ideal_chunks); // similarly, if _Clamped_ideal_chunks is odd, that would break our 2 to even power invariant, diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 085bdd7d2f..a9bb2159ab 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -392,10 +392,10 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #ifdef _M_IX86 #define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__stdcall, OPT1, OPT2, OPT3) #define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__thiscall, OPT1, OPT2, OPT3) -#else // ^^^ _M_IX86 ^^^ / vvv !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) ^^^ / vvv !defined(_M_IX86) vvv #define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) #define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) -#endif // ^^^ !_M_IX86 ^^^ +#endif // ^^^ !defined(_M_IX86) ^^^ #if ((defined(_M_IX86) && _M_IX86_FP >= 2) || defined(_M_X64)) && !defined(_M_CEE) #define _EMIT_VECTORCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__vectorcall, OPT1, OPT2, OPT3) @@ -426,9 +426,9 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \ _NON_MEMBER_CALL_CV_REF(FUNC, ) \ _NON_MEMBER_CALL_CV_REF(FUNC, noexcept) -#else // ^^^ __cpp_noexcept_function_type ^^^ / vvv !__cpp_noexcept_function_type vvv +#else // ^^^ defined(__cpp_noexcept_function_type) ^^^ / vvv !defined(__cpp_noexcept_function_type) vvv #define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _NON_MEMBER_CALL_CV_REF(FUNC, ) -#endif // ^^^ !__cpp_noexcept_function_type ^^^ +#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^ #define _MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ _EMIT_CDECL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ @@ -453,9 +453,9 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \ _MEMBER_CALL_CV_REF(FUNC, ) \ _MEMBER_CALL_CV_REF(FUNC, noexcept) -#else // ^^^ __cpp_noexcept_function_type ^^^ / vvv !__cpp_noexcept_function_type vvv +#else // ^^^ defined(__cpp_noexcept_function_type) ^^^ / vvv !defined(__cpp_noexcept_function_type) vvv #define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _MEMBER_CALL_CV_REF(FUNC, ) -#endif // ^^^ !__cpp_noexcept_function_type ^^^ +#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^ #ifdef __cpp_noexcept_function_type #define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \ @@ -483,7 +483,7 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; CLASS(const&& noexcept) \ CLASS(volatile&& noexcept) \ CLASS(const volatile&& noexcept) -#else // ^^^ __cpp_noexcept_function_type ^^^ / vvv !__cpp_noexcept_function_type vvv +#else // ^^^ defined(__cpp_noexcept_function_type) ^^^ / vvv !defined(__cpp_noexcept_function_type) vvv #define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \ CLASS(_EMPTY_ARGUMENT) \ CLASS(const) \ @@ -497,7 +497,7 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; CLASS(const&&) \ CLASS(volatile&&) \ CLASS(const volatile&&) -#endif // ^^^ !__cpp_noexcept_function_type ^^^ +#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^ template struct _Arg_types {}; // provide argument_type, etc. when sizeof...(_Types) is 1 or 2 diff --git a/stl/inc/xatomic.h b/stl/inc/xatomic.h index 3efe4e43e0..fa275badbf 100644 --- a/stl/inc/xatomic.h +++ b/stl/inc/xatomic.h @@ -99,7 +99,7 @@ enum memory_order { memory_order_acq_rel, memory_order_seq_cst }; -#endif // ^^^ _HAS_CXX20 ^^^ +#endif // ^^^ !_HAS_CXX20 ^^^ using _Atomic_counter_t = unsigned long; diff --git a/stl/inc/xutility b/stl/inc/xutility index 7f4c8e7489..2e53d191a9 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -1047,7 +1047,7 @@ using _Iter_value_t = iter_value_t<_Iter>; template using _Iter_diff_t = iter_difference_t<_Iter>; -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template using _Iter_ref_t = typename iterator_traits<_Iter>::reference; @@ -1059,7 +1059,7 @@ using _Iter_diff_t = typename iterator_traits<_Iter>::difference_type; template using _Make_unsigned_like_t = make_unsigned_t<_Ty>; -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ template using _Common_diff_t = common_type_t<_Iter_diff_t<_Iters>...>; @@ -1494,9 +1494,9 @@ public: conditional_t, random_access_iterator_tag, bidirectional_iterator_tag>; using iterator_category = conditional_t, random_access_iterator_tag>, random_access_iterator_tag, _Iter_cat_t<_BidIt>>; -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv using iterator_category = _Iter_cat_t<_BidIt>; -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ using value_type = _Iter_value_t<_BidIt>; using difference_type = _Iter_diff_t<_BidIt>; using pointer = typename iterator_traits<_BidIt>::pointer; @@ -4023,10 +4023,10 @@ public: using iterator_concept = decltype(_Get_iter_concept()); using reference = iter_rvalue_reference_t<_Iter>; -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv using reference = conditional_t>, remove_reference_t<_Iter_ref_t<_Iter>>&&, _Iter_ref_t<_Iter>>; -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ _CONSTEXPR17 move_iterator() = default; @@ -4061,23 +4061,23 @@ public: _NODISCARD constexpr iterator_type base() && noexcept(is_nothrow_move_constructible_v<_Iter>) /* strengthened */ { return _STD move(_Current); } -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv _NODISCARD _CONSTEXPR17 iterator_type base() const noexcept(is_nothrow_copy_constructible_v<_Iter>) /* strengthened */ { return _Current; } -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ _NODISCARD _CONSTEXPR17 reference operator*() const #ifdef __cpp_lib_concepts noexcept(noexcept(_RANGES iter_move(_Current))) /* strengthened */ { return _RANGES iter_move(_Current); } -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv noexcept(noexcept(static_cast(*_Current))) /* strengthened */ { return static_cast(*_Current); } -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ _CXX20_DEPRECATE_MOVE_ITERATOR_ARROW _NODISCARD _CONSTEXPR17 pointer operator->() const noexcept(is_nothrow_copy_constructible_v<_Iter>) /* strengthened */ { @@ -4154,10 +4154,10 @@ public: #ifdef __cpp_lib_concepts noexcept(noexcept(_RANGES iter_move(_Current + _Off))) /* strengthened */ { return _RANGES iter_move(_Current + _Off); -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv noexcept(noexcept(_STD move(_Current[_Off]))) /* strengthened */ { return _STD move(_Current[_Off]); -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ } #ifdef __cpp_lib_concepts From 6b3ffb25ee6d566c5172b2a9705b52729686998c Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 12:30:25 +0300 Subject: [PATCH 10/36] source --- stl/src/awint.hpp | 4 ++-- stl/src/cerr.cpp | 4 ++-- stl/src/cin.cpp | 4 ++-- stl/src/clog.cpp | 4 ++-- stl/src/cout.cpp | 4 ++-- stl/src/filesys.cpp | 36 ++++++++++++++++++------------------ stl/src/init_locks.hpp | 4 ++-- stl/src/locale0.cpp | 4 ++-- stl/src/mutex.cpp | 4 ++-- stl/src/winapisupp.cpp | 14 +++++++------- stl/src/xmtx.hpp | 4 ++-- 11 files changed, 43 insertions(+), 43 deletions(-) diff --git a/stl/src/awint.hpp b/stl/src/awint.hpp index 7d9e4f80a0..6154689ce3 100644 --- a/stl/src/awint.hpp +++ b/stl/src/awint.hpp @@ -17,11 +17,11 @@ _CRT_BEGIN_C_HEADER #define __crtGetSystemTimePreciseAsFileTime(lpSystemTimeAsFileTime) \ GetSystemTimePreciseAsFileTime(lpSystemTimeAsFileTime) -#else // _STL_WIN32_WINNT >= _WIN32_WINNT_WIN8 +#else // ^^^ _STL_WIN32_WINNT >= _WIN32_WINNT_WIN8 ^^^ / vvv _STL_WIN32_WINNT < _WIN32_WINNT_WIN8 vvv _CRTIMP2 void __cdecl __crtGetSystemTimePreciseAsFileTime(_Out_ LPFILETIME lpSystemTimeAsFileTime); -#endif // _STL_WIN32_WINNT >= _WIN32_WINNT_WIN8 +#endif // ^^^ _STL_WIN32_WINNT < _WIN32_WINNT_WIN8 ^^^ _CRTIMP2 int __cdecl __crtCompareStringA(_In_z_ LPCWSTR _LocaleName, _In_ DWORD _DwCmpFlags, _In_reads_(_CchCount1) LPCSTR _LpString1, _In_ int _CchCount1, _In_reads_(_CchCount2) LPCSTR _LpString2, diff --git a/stl/src/cerr.cpp b/stl/src/cerr.cpp index 44a99531e0..dd19438821 100644 --- a/stl/src/cerr.cpp +++ b/stl/src/cerr.cpp @@ -19,9 +19,9 @@ __PURE_APPDOMAIN_GLOBAL static filebuf ferr(_cpp_stderr); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern ostream cerr(&ferr); -#else // defined(_M_CEE_PURE) +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cerr(&ferr); -#endif // defined(_M_CEE_PURE) +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ struct _Init_cerr { // ensures that cerr is initialized __CLR_OR_THIS_CALL _Init_cerr() { // initialize cerr diff --git a/stl/src/cin.cpp b/stl/src/cin.cpp index 4900af2389..27d75e8ce9 100644 --- a/stl/src/cin.cpp +++ b/stl/src/cin.cpp @@ -19,9 +19,9 @@ __PURE_APPDOMAIN_GLOBAL static filebuf fin(_cpp_stdin); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern istream cin(&fin); -#else // defined(_M_CEE_PURE) +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT istream cin(&fin); -#endif // defined(_M_CEE_PURE) +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ struct _Init_cin { // ensures that cin is initialized __CLR_OR_THIS_CALL _Init_cin() { // initialize cin diff --git a/stl/src/clog.cpp b/stl/src/clog.cpp index 32d3ea3f7b..33f7d5ec74 100644 --- a/stl/src/clog.cpp +++ b/stl/src/clog.cpp @@ -21,9 +21,9 @@ __PURE_APPDOMAIN_GLOBAL static filebuf flog(_cpp_stderr); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern ostream clog(&flog); -#else // defined(_M_CEE_PURE) +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream clog(&flog); -#endif // defined(_M_CEE_PURE) +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ struct _Init_clog { // ensures that clog is initialized __CLR_OR_THIS_CALL _Init_clog() { // initialize clog diff --git a/stl/src/cout.cpp b/stl/src/cout.cpp index a10d0e7825..748d2a398e 100644 --- a/stl/src/cout.cpp +++ b/stl/src/cout.cpp @@ -19,9 +19,9 @@ __PURE_APPDOMAIN_GLOBAL static filebuf fout(_cpp_stdout); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern ostream cout(&fout); -#else // defined(_M_CEE_PURE) +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cout(&fout); -#endif // defined(_M_CEE_PURE) +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ struct _Init_cout { // ensures that cout is initialized __CLR_OR_THIS_CALL _Init_cout() { // initialize cout diff --git a/stl/src/filesys.cpp b/stl/src/filesys.cpp index 818d78c7f4..1bf3bd18b2 100644 --- a/stl/src/filesys.cpp +++ b/stl/src/filesys.cpp @@ -55,10 +55,10 @@ static HANDLE _FilesysOpenFile(const wchar_t* _Fname, DWORD _Desired_access, DWO return CreateFile2(_Fname, _Desired_access, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, OPEN_EXISTING, &_Create_file_parameters); -#else // _CRT_APP +#else // ^^^ defined(_CRT_APP) ^^^ / vvv !defined(_CRT_APP) vvv return CreateFileW(_Fname, _Desired_access, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, _Flags, nullptr); -#endif // _CRT_APP +#endif // ^^^ !defined(_CRT_APP) ^^^ } _FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Read_dir( @@ -82,13 +82,13 @@ _FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Read_dir( static unsigned int _Filesys_code_page() { // determine appropriate code page #if defined(_ONECORE) return CP_ACP; -#else // defined(_ONECORE) +#else // ^^^ defined(_ONECORE) ^^^ / vvv !defined(_ONECORE) vvv if (AreFileApisANSI()) { return CP_ACP; } else { return CP_OEMCP; } -#endif // defined(_ONECORE) +#endif // ^^^ !defined(_ONECORE) ^^^ } _FS_DLL int __CLRCALL_PURE_OR_CDECL _To_wide(const char* _Bsrc, wchar_t* _Wdest) { @@ -143,9 +143,9 @@ _FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_get(wchar_t (&_Dest)[_MAX_FILESYS_ _Strcpy(_Dest, L""); #ifdef _CRT_APP return false; // no support -#else // _CRT_APP +#else // ^^^ defined(_CRT_APP) ^^^ / vvv !defined(_CRT_APP) vvv return _wgetcwd(_Dest, _MAX_FILESYS_NAME) != nullptr; -#endif // _CRT_APP +#endif // ^^^ !defined(_CRT_APP) ^^^ } _FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_set(const wchar_t* _Dirname) { @@ -153,9 +153,9 @@ _FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_set(const wchar_t* _Dirname) { #ifdef _CRT_APP (void) _Dirname; return false; // no support -#else // _CRT_APP +#else // ^^^ defined(_CRT_APP) ^^^ / vvv !defined(_CRT_APP) vvv return _wchdir(_Dirname) == 0; -#endif // _CRT_APP +#endif // ^^^ !defined(_CRT_APP) ^^^ } _FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Symlink_get(wchar_t (&_Dest)[_MAX_FILESYS_NAME], const wchar_t*) { @@ -235,14 +235,14 @@ _FS_DLL uintmax_t __CLRCALL_PURE_OR_CDECL _Hard_links(const wchar_t* _Fname) { const auto _Ok = GetFileInformationByHandleEx(_Handle, FileStandardInfo, &_Info, sizeof(_Info)); CloseHandle(_Handle); return _Ok ? _Info.NumberOfLinks : static_cast(-1); -#else // _CRT_APP +#else // ^^^ defined(_CRT_APP) ^^^ / vvv !defined(_CRT_APP) vvv BY_HANDLE_FILE_INFORMATION _Info = {0}; // get file info const auto _Ok = GetFileInformationByHandle(_Handle, &_Info); CloseHandle(_Handle); return _Ok ? _Info.nNumberOfLinks : static_cast(-1); -#endif // _CRT_APP +#endif // ^^^ !defined(_CRT_APP) ^^^ } _FS_DLL uintmax_t __CLRCALL_PURE_OR_CDECL _File_size(const wchar_t* _Fname) { // get file size @@ -345,7 +345,7 @@ _FS_DLL int __CLRCALL_PURE_OR_CDECL _Equivalent( } else { // test existing files for equivalence return memcmp(&_Info1, &_Info2, sizeof(_FILE_ID_INFO)) == 0 ? 1 : 0; } -#else // _CRT_APP +#else // ^^^ defined(_CRT_APP) ^^^ / vvv !defined(_CRT_APP) vvv BY_HANDLE_FILE_INFORMATION _Info1 = {0}; BY_HANDLE_FILE_INFORMATION _Info2 = {0}; bool _Ok1 = false; @@ -373,7 +373,7 @@ _FS_DLL int __CLRCALL_PURE_OR_CDECL _Equivalent( ? 1 : 0; } -#endif // _CRT_APP +#endif // ^^^ !defined(_CRT_APP) ^^^ } _FS_DLL int __CLRCALL_PURE_OR_CDECL _Link(const wchar_t* _Fname1, const wchar_t* _Fname2) { @@ -382,9 +382,9 @@ _FS_DLL int __CLRCALL_PURE_OR_CDECL _Link(const wchar_t* _Fname1, const wchar_t* (void) _Fname1; (void) _Fname2; return errno = EDOM; // hardlinks not supported -#else // _CRT_APP +#else // ^^^ defined(_CRT_APP) ^^^ / vvv !defined(_CRT_APP) vvv return CreateHardLinkW(_Fname2, _Fname1, nullptr) ? 0 : GetLastError(); -#endif // _CRT_APP +#endif // ^^^ !defined(_CRT_APP) ^^^ } _FS_DLL int __CLRCALL_PURE_OR_CDECL _Symlink(const wchar_t* _Fname1, const wchar_t* _Fname2) { @@ -393,9 +393,9 @@ _FS_DLL int __CLRCALL_PURE_OR_CDECL _Symlink(const wchar_t* _Fname1, const wchar (void) _Fname1; (void) _Fname2; return errno = EDOM; // symlinks not supported -#else // _CRT_APP +#else // ^^^ defined(_CRT_APP) ^^^ / vvv !defined(_CRT_APP) vvv return CreateSymbolicLinkW(_Fname2, _Fname1, 0) ? 0 : GetLastError(); -#endif // _CRT_APP +#endif // ^^^ !defined(_CRT_APP) ^^^ } _FS_DLL int __CLRCALL_PURE_OR_CDECL _Rename(const wchar_t* _Fname1, const wchar_t* _Fname2) { @@ -438,9 +438,9 @@ _FS_DLL int __CLRCALL_PURE_OR_CDECL _Copy_file(const wchar_t* _Fname1, const wch // take lower bits to undo HRESULT_FROM_WIN32 return _Copy_result & 0x0000FFFFU; -#else // defined(_ONECORE) +#else // ^^^ defined(_ONECORE) ^^^ / vvv !defined(_ONECORE) vvv return CopyFileW(_Fname1, _Fname2, 0) ? 0 : GetLastError(); -#endif // defined(_ONECORE) +#endif // ^^^ !defined(_ONECORE) ^^^ } _FS_DLL int __CLRCALL_PURE_OR_CDECL _Chmod(const wchar_t* _Fname, perms _Newmode) { diff --git a/stl/src/init_locks.hpp b/stl/src/init_locks.hpp index 986457a000..3f7ab2ac4c 100644 --- a/stl/src/init_locks.hpp +++ b/stl/src/init_locks.hpp @@ -18,10 +18,10 @@ class _CRTIMP2_PURE_IMPORT _Init_locks { // initialize mutexes _Init_locks_dtor(this); } -#else // _M_CEE_PURE +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv __thiscall _Init_locks() noexcept; __thiscall ~_Init_locks() noexcept; -#endif // _M_CEE_PURE +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ private: static void __cdecl _Init_locks_ctor(_Init_locks*) noexcept; diff --git a/stl/src/locale0.cpp b/stl/src/locale0.cpp index 733c84450a..5ed8a2b4cd 100644 --- a/stl/src/locale0.cpp +++ b/stl/src/locale0.cpp @@ -65,9 +65,9 @@ __PURE_APPDOMAIN_GLOBAL const _Fac_tidy_reg_t _Fac_tidy_reg; #if defined(_M_CEE) void __CLRCALL_OR_CDECL _Facet_Register_m(_Facet_base* _This) -#else // defined(_M_CEE) +#else // ^^^ defined(_M_CEE) ^^^ / vvv !defined(_M_CEE) vvv void __CLRCALL_OR_CDECL _Facet_Register(_Facet_base* _This) -#endif // defined(_M_CEE) +#endif // ^^^ !defined(_M_CEE) ^^^ { // queue up lazy facet for destruction _Fac_head = new _Fac_node(_Fac_head, _This); } diff --git a/stl/src/mutex.cpp b/stl/src/mutex.cpp index 9dbabc1800..a1dc473960 100644 --- a/stl/src/mutex.cpp +++ b/stl/src/mutex.cpp @@ -29,9 +29,9 @@ extern "C" [[noreturn]] _CRTIMP2_PURE void _Thrd_abort(const char* msg) { // abo #define _THREAD_QUOTX(x) #x #define _THREAD_QUOT(x) _THREAD_QUOTX(x) #define _THREAD_ASSERT(expr, msg) ((expr) ? (void) 0 : _Thrd_abort(__FILE__ "(" _THREAD_QUOT(__LINE__) "): " msg)) -#else // _THREAD_CHECKX +#else // ^^^ _THREAD_CHECKX ^^^ / vvv !_THREAD_CHECKX vvv #define _THREAD_ASSERT(expr, msg) ((void) 0) -#endif // _THREAD_CHECKX +#endif // ^^^ !_THREAD_CHECKX ^^^ // TRANSITION, ABI: preserved for binary compatibility enum class __stl_sync_api_modes_enum { normal, win7, vista, concrt }; diff --git a/stl/src/winapisupp.cpp b/stl/src/winapisupp.cpp index 5ac59987fe..fb8f429a18 100644 --- a/stl/src/winapisupp.cpp +++ b/stl/src/winapisupp.cpp @@ -98,7 +98,7 @@ extern "C" int __crt_IsPackagedAppHelper() { return 0; } -#else // defined _ONECORE +#else // ^^^ defined(_ONECORE) ^^^ / vvv !defined(_ONECORE) vvv extern "C" int __crt_IsPackagedAppHelper() { LONG retValue = APPMODEL_ERROR_NO_PACKAGE; @@ -273,9 +273,9 @@ extern "C" _CRTIMP2 BOOLEAN __cdecl __crtCreateSymbolicLinkW( (void) dwFlags; SetLastError(ERROR_NOT_SUPPORTED); return 0; -#else // _CRT_APP +#else // ^^^ defined(_CRT_APP) ^^^ / vvv !defined(_CRT_APP) vvv return CreateSymbolicLinkW(lpSymlinkFileName, lpTargetFileName, dwFlags); -#endif // _CRT_APP +#endif // ^^^ !defined(_CRT_APP) ^^^ } // TRANSITION, ABI: preserved for binary compatibility @@ -351,13 +351,13 @@ extern "C" VOID __cdecl __crtCloseThreadpoolWork(_Inout_ PTP_WORK const pwk) { CloseThreadpoolWork(pwk); } -#else // _STL_WIN32_WINNT < _WIN32_WINNT_VISTA +#else // ^^^ _STL_WIN32_WINNT < _WIN32_WINNT_VISTA ^^^ / vvv _STL_WIN32_WINNT >= _WIN32_WINNT_VISTA vvv // TRANSITION, ABI: preserved for binary compatibility extern "C" BOOL __cdecl __crtQueueUserWorkItem(_In_ LPTHREAD_START_ROUTINE, _In_opt_ PVOID, _In_ ULONG) { // This function doesn't have an implementation as it is only used on Windows XP return 0; } -#endif // _STL_WIN32_WINNT < _WIN32_WINNT_VISTA +#endif // ^^^ _STL_WIN32_WINNT >= _WIN32_WINNT_VISTA ^^^ #if _STL_WIN32_WINNT < _WIN32_WINNT_WIN7 // TRANSITION, ABI: preserved for binary compatibility @@ -401,7 +401,7 @@ extern "C" _Success_(return > 0 && return < BufferLength) DWORD // All APIs are statically available, and we can't call GetModuleHandleW(). -#else // defined _ONECORE +#else // ^^^ defined(_ONECORE) ^^^ / vvv !defined(_ONECORE) vvv static int __cdecl initialize_pointers() { HINSTANCE hKernel32 = GetModuleHandleW(L"kernel32.dll"); @@ -424,4 +424,4 @@ static int __cdecl initialize_pointers() { _CRTALLOC(".CRT$XIC") static _PIFV pinit = initialize_pointers; -#endif // defined _ONECORE +#endif // ^^^ !defined(_ONECORE) ^^^ diff --git a/stl/src/xmtx.hpp b/stl/src/xmtx.hpp index 44eb904eba..cac5c1366c 100644 --- a/stl/src/xmtx.hpp +++ b/stl/src/xmtx.hpp @@ -19,11 +19,11 @@ void __clrcall _Mtxdst(_Rmtx*) noexcept; void __clrcall _Mtxlock(_Rmtx*) noexcept; void __clrcall _Mtxunlock(_Rmtx*) noexcept; -#else // _M_CEE_PURE +#else // ^^^ defined(_M_CEE_PURE) ^^^ / vvv !defined(_M_CEE_PURE) vvv _MRTIMP2 void __cdecl _Mtxinit(_Rmtx*) noexcept; _MRTIMP2 void __cdecl _Mtxdst(_Rmtx*) noexcept; _MRTIMP2 void __cdecl _Mtxlock(_Rmtx*) noexcept; _MRTIMP2 void __cdecl _Mtxunlock(_Rmtx*) noexcept; -#endif // _M_CEE_PURE +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ _END_EXTERN_C_UNLESS_PURE From d1cf6fb0ee6659e8c4a978dc54da3591f8639971 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 12:37:02 +0300 Subject: [PATCH 11/36] -whitespace --- stl/src/filesys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/src/filesys.cpp b/stl/src/filesys.cpp index 1bf3bd18b2..2c7ca183ff 100644 --- a/stl/src/filesys.cpp +++ b/stl/src/filesys.cpp @@ -88,7 +88,7 @@ static unsigned int _Filesys_code_page() { // determine appropriate code page } else { return CP_OEMCP; } -#endif // ^^^ !defined(_ONECORE) ^^^ +#endif // ^^^ !defined(_ONECORE) ^^^ } _FS_DLL int __CLRCALL_PURE_OR_CDECL _To_wide(const char* _Bsrc, wchar_t* _Wdest) { From 5c91788c16ca760306079715f849c9a6662fbbf1 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 12:38:16 +0300 Subject: [PATCH 12/36] -whitespace --- stl/src/locale0.cpp | 2 +- stl/src/xmtx.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/src/locale0.cpp b/stl/src/locale0.cpp index 5ed8a2b4cd..70cbe539bf 100644 --- a/stl/src/locale0.cpp +++ b/stl/src/locale0.cpp @@ -67,7 +67,7 @@ __PURE_APPDOMAIN_GLOBAL const _Fac_tidy_reg_t _Fac_tidy_reg; void __CLRCALL_OR_CDECL _Facet_Register_m(_Facet_base* _This) #else // ^^^ defined(_M_CEE) ^^^ / vvv !defined(_M_CEE) vvv void __CLRCALL_OR_CDECL _Facet_Register(_Facet_base* _This) -#endif // ^^^ !defined(_M_CEE) ^^^ +#endif // ^^^ !defined(_M_CEE) ^^^ { // queue up lazy facet for destruction _Fac_head = new _Fac_node(_Fac_head, _This); } diff --git a/stl/src/xmtx.hpp b/stl/src/xmtx.hpp index cac5c1366c..1b869a484f 100644 --- a/stl/src/xmtx.hpp +++ b/stl/src/xmtx.hpp @@ -24,6 +24,6 @@ _MRTIMP2 void __cdecl _Mtxinit(_Rmtx*) noexcept; _MRTIMP2 void __cdecl _Mtxdst(_Rmtx*) noexcept; _MRTIMP2 void __cdecl _Mtxlock(_Rmtx*) noexcept; _MRTIMP2 void __cdecl _Mtxunlock(_Rmtx*) noexcept; -#endif // ^^^ !defined(_M_CEE_PURE) ^^^ +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ _END_EXTERN_C_UNLESS_PURE From ea3863e98c9a7a5c0a7e607b626e245f05149d44 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 12:52:42 +0300 Subject: [PATCH 13/36] More defined(...) --- stl/inc/atomic | 4 ++-- stl/inc/compare | 4 ++-- stl/inc/filesystem | 4 ++-- stl/inc/functional | 4 ++-- stl/inc/memory_resource | 8 ++++---- stl/inc/ostream | 2 +- stl/inc/span | 8 ++++---- stl/inc/stacktrace | 4 ++-- stl/inc/utility | 4 ++-- stl/inc/yvals.h | 4 ++-- stl/inc/yvals_core.h | 8 ++++---- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/stl/inc/atomic b/stl/inc/atomic index 2c7d642e65..dd8e0c08c9 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -96,9 +96,9 @@ enum { #ifndef _INVALID_MEMORY_ORDER #ifdef _DEBUG #define _INVALID_MEMORY_ORDER _STL_REPORT_ERROR("Invalid memory order") -#else // ^^^ _DEBUG / !_DEBUG vvv +#else // ^^^ defined(_DEBUG) / !defined(_DEBUG) vvv #define _INVALID_MEMORY_ORDER -#endif // _DEBUG +#endif // ^^^ !defined(_DEBUG) ^^^ #endif // _INVALID_MEMORY_ORDER extern "C" inline void _Check_memory_order(const unsigned int _Order) noexcept { diff --git a/stl/inc/compare b/stl/inc/compare index 04b3d5292f..1d984a91bf 100644 --- a/stl/inc/compare +++ b/stl/inc/compare @@ -14,9 +14,9 @@ _EMIT_STL_WARNING(STL4038, "The contents of are available only with C+ #else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv #ifdef __cpp_lib_concepts #include -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv #include -#endif // !__cpp_lib_concepts +#endif // !defined(__cpp_lib_concepts) #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/filesystem b/stl/inc/filesystem index 91a1418f32..a9c0b44d51 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -940,9 +940,9 @@ namespace filesystem { _NODISCARD auto u8string() const { // convert the native path from this instance into a UTF-8 string #ifdef __cpp_lib_char8_t using _U8Ty = char8_t; -#else // ^^^ __cpp_lib_char8_t / !__cpp_lib_char8_t vvv +#else // ^^^ deined(__cpp_lib_char8_t) / !deined(__cpp_lib_char8_t) vvv using _U8Ty = char; -#endif // __cpp_lib_char8_t +#endif // ^^^ !deined(__cpp_lib_char8_t) ^^^ return _Convert_wide_to_narrow>(__std_code_page::_Utf8, _Text, allocator<_U8Ty>{}); } diff --git a/stl/inc/functional b/stl/inc/functional index c1de0b6d08..028651736d 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -1285,9 +1285,9 @@ void __stdcall _Function_deallocate_large_overaligned(_Move_only_function_data& _STL_INTERNAL_STATIC_ASSERT(_Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__); #ifdef __cpp_aligned_new ::operator delete(_Self._Large_fn_ptr(), align_val_t{_Align}); -#else // ^^^ __cpp_aligned_new / !__cpp_aligned_new vvv +#else // ^^^ defined(__cpp_aligned_new) / !defined(__cpp_aligned_new) vvv ::operator delete(_Self._Large_fn_ptr()); -#endif // __cpp_aligned_new +#endif // ^^^ !defined(__cpp_aligned_new) ^^^ } template diff --git a/stl/inc/memory_resource b/stl/inc/memory_resource index eee7f03236..4504977750 100644 --- a/stl/inc/memory_resource +++ b/stl/inc/memory_resource @@ -38,9 +38,9 @@ namespace pmr { _EXPORT_STD inline memory_resource* set_default_resource(memory_resource* const _Resource) noexcept { #ifdef __cpp_aligned_new return _Aligned_set_default_resource(_Resource); -#else // ^^^ __cpp_aligned_new / !__cpp_aligned_new vvv +#else // ^^^ defined(__cpp_aligned_new) / !defined(__cpp_aligned_new) vvv return _Unaligned_set_default_resource(_Resource); -#endif // __cpp_aligned_new +#endif // ^^^ !defined(__cpp_aligned_new) ^^^ } _EXPORT_STD extern "C" _NODISCARD _CRT_SATELLITE_1 memory_resource* __cdecl null_memory_resource() noexcept; @@ -96,12 +96,12 @@ namespace pmr { return _Aligned_new_delete_resource(); } -#else // ^^^ __cpp_aligned_new / !__cpp_aligned_new vvv +#else // ^^^ defined(__cpp_aligned_new) / !defined(__cpp_aligned_new) vvv _EXPORT_STD _NODISCARD inline memory_resource* new_delete_resource() noexcept { return _Unaligned_new_delete_resource(); } -#endif // __cpp_aligned_new +#endif // ^^^ !defined(__cpp_aligned_new) ^^^ template struct _Double_link { // base class for intrusive doubly-linked structures diff --git a/stl/inc/ostream b/stl/inc/ostream index c727f5ab08..5651775c46 100644 --- a/stl/inc/ostream +++ b/stl/inc/ostream @@ -1276,7 +1276,7 @@ _EXPORT_STD template // improves throughput, see GH-2329 void vprint_nonunicode(ostream& _Ostr, const string_view _Fmt_str, const format_args _Fmt_args) { _STD _Vprint_nonunicode_impl(_Add_newline::_Nope, _Ostr, _Fmt_str, _Fmt_args); } -#else // ^^^ _CPPRTTI / !_CPPRTTI vvv +#else // ^^^ defined(_CPPRTTI) ^^^ / vvv !defined(_CPPRTTI) vvv _EXPORT_STD template void print(ostream&, format_string<_Types...>, _Types&&...) = delete; // requires /GR option diff --git a/stl/inc/span b/stl/inc/span index 6f59af0c54..a5264cd36c 100644 --- a/stl/inc/span +++ b/stl/inc/span @@ -258,7 +258,7 @@ concept _Span_compatible_range = && (_RANGES borrowed_range<_Rng> || is_const_v<_Ty>) && is_convertible_v>(*)[], _Ty(*)[]>; // clang-format on -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template struct _Is_span : false_type {}; @@ -291,7 +291,7 @@ inline constexpr bool _Is_span_compatible_range = conjunction_v< // _Has_container_interface<_Rng>, // _Is_span_convertible_range<_Rng, _Ty>>; -#endif // !__cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ // [views.span] _EXPORT_STD template @@ -389,7 +389,7 @@ public: } // clang-format on -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template = 0> constexpr span() noexcept {} @@ -468,7 +468,7 @@ public: #endif // _CONTAINER_DEBUG_LEVEL > 0 } -#endif // !__cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ // [span.sub] Subviews template diff --git a/stl/inc/stacktrace b/stl/inc/stacktrace index b3f96a181f..2a7b81371c 100644 --- a/stl/inc/stacktrace +++ b/stl/inc/stacktrace @@ -267,7 +267,7 @@ public: #ifdef __cpp_lib_concepts return _STD lexicographical_compare_three_way(_Lhs.begin(), _Lhs.end(), _Rhs.begin(), _Rhs.end()); -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv for (size_t _Ix = 0, _Mx = _Lhs._Frames.size(); _Ix != _Mx; ++_Ix) { if (_Lhs._Frames[_Ix] != _Rhs._Frames[_Ix]) { return _Lhs._Frames[_Ix] <=> _Rhs._Frames[_Ix]; @@ -275,7 +275,7 @@ public: } return strong_ordering::equal; -#endif // ^^^ !__cpp_lib_concepts ^^^ +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ } void swap(basic_stacktrace& _Other) noexcept(allocator_traits<_Alloc>::propagate_on_container_swap::value diff --git a/stl/inc/utility b/stl/inc/utility index 13b48be3e8..ca2d4543b0 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -906,13 +906,13 @@ using _With_reference = _Ty&; template concept _Can_reference = requires { typename _With_reference<_Ty>; }; -#else // ^^^__cpp_lib_concepts ^^^ / vvv !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template inline constexpr bool _Can_reference = false; template inline constexpr bool _Can_reference<_Ty, void_t<_Ty&>> = true; -#endif // ^^^__cpp_lib_concepts ^^^ +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ #endif // _HAS_CXX20 #if _HAS_CXX23 diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index 90e612d998..4391ceba28 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -175,9 +175,9 @@ _STL_DISABLE_CLANG_WARNINGS #define _STL_CRT_SECURE_INVALID_PARAMETER(expr) ::abort() #elif defined(_DEBUG) // avoid emitting unused long strings for function names; see GH-1956 #define _STL_CRT_SECURE_INVALID_PARAMETER(expr) ::_invalid_parameter(_CRT_WIDE(#expr), L"", __FILEW__, __LINE__, 0) -#else // _DEBUG +#else // ^^^ defined(_DEBUG) ^^^ / vvv !defined(_DEBUG) vvv #define _STL_CRT_SECURE_INVALID_PARAMETER(expr) _CRT_SECURE_INVALID_PARAMETER(expr) -#endif // _DEBUG +#endif // ^^^ !defined(_DEBUG) ^^^ #endif // _STL_CRT_SECURE_INVALID_PARAMETER #define _STL_REPORT_ERROR(mesg) \ diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index a474e1d1cf..42e3f0245e 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -829,17 +829,17 @@ _Pragma("clang diagnostic ignored \"-Wuser-defined-literals\"") \ _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") // clang-format on -#else // ^^^ __clang__ ^^^ / vvv !__clang__ vvv +#else // ^^^ defined(__clang__) ^^^ / vvv !defined(__clang__) vvv #define _STL_DISABLE_CLANG_WARNINGS -#endif // ^^^ !__clang__ ^^^ +#endif // ^^^ !defined(__clang__) ^^^ #endif // _STL_DISABLE_CLANG_WARNINGS #ifndef _STL_RESTORE_CLANG_WARNINGS #ifdef __clang__ #define _STL_RESTORE_CLANG_WARNINGS _Pragma("clang diagnostic pop") -#else // ^^^ __clang__ ^^^ / vvv !__clang__ vvv +#else // ^^^ defined(__clang__) ^^^ / vvv !defined(__clang__) vvv #define _STL_RESTORE_CLANG_WARNINGS -#endif // ^^^ !__clang__ ^^^ +#endif // ^^^ !defined(__clang__) ^^^ #endif // _STL_RESTORE_CLANG_WARNINGS // clang-format off From de8f8b4735f24aaa97a736bbc05c97616d8a45d7 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 12:55:24 +0300 Subject: [PATCH 14/36] defined(...) --- stl/inc/filesystem | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/filesystem b/stl/inc/filesystem index a9c0b44d51..799fb8df23 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -940,9 +940,9 @@ namespace filesystem { _NODISCARD auto u8string() const { // convert the native path from this instance into a UTF-8 string #ifdef __cpp_lib_char8_t using _U8Ty = char8_t; -#else // ^^^ deined(__cpp_lib_char8_t) / !deined(__cpp_lib_char8_t) vvv +#else // ^^^ defined(__cpp_lib_char8_t) / !defined(__cpp_lib_char8_t) vvv using _U8Ty = char; -#endif // ^^^ !deined(__cpp_lib_char8_t) ^^^ +#endif // ^^^ !defined(__cpp_lib_char8_t) ^^^ return _Convert_wide_to_narrow>(__std_code_page::_Utf8, _Text, allocator<_U8Ty>{}); } From fcc21a093d04f19d01bff874913e3f43dd1270d8 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 22 Jul 2023 15:42:04 +0300 Subject: [PATCH 15/36] some `#endif` s --- stl/inc/__msvc_cxx_stdatomic.hpp | 6 +- stl/inc/__msvc_filebuf.hpp | 10 +-- stl/inc/__msvc_iter_core.hpp | 2 +- stl/inc/algorithm | 112 +++++++++++++++--------------- stl/inc/array | 4 +- stl/inc/atomic | 6 +- stl/inc/barrier | 4 +- stl/inc/chrono | 10 +-- stl/inc/compare | 2 +- stl/inc/complex | 4 +- stl/inc/concepts | 4 +- stl/inc/coroutine | 6 +- stl/inc/csignal | 2 +- stl/inc/cstddef | 2 +- stl/inc/exception | 8 +-- stl/inc/execution | 2 +- stl/inc/expected | 4 +- stl/inc/experimental/coroutine | 2 +- stl/inc/experimental/filesystem | 4 +- stl/inc/experimental/generator | 8 +-- stl/inc/filesystem | 10 +-- stl/inc/format | 2 +- stl/inc/fstream | 12 ++-- stl/inc/functional | 16 ++--- stl/inc/ios | 2 +- stl/inc/iosfwd | 8 +-- stl/inc/iostream | 2 +- stl/inc/istream | 10 +-- stl/inc/iterator | 22 +++--- stl/inc/limits | 2 +- stl/inc/locale | 6 +- stl/inc/memory | 34 ++++----- stl/inc/memory_resource | 6 +- stl/inc/new | 4 +- stl/inc/optional | 18 ++--- stl/inc/ostream | 6 +- stl/inc/print | 2 +- stl/inc/queue | 8 +-- stl/inc/ranges | 4 +- stl/inc/regex | 4 +- stl/inc/semaphore | 2 +- stl/inc/shared_mutex | 2 +- stl/inc/span | 4 +- stl/inc/spanstream | 6 +- stl/inc/stack | 8 +-- stl/inc/streambuf | 2 +- stl/inc/thread | 2 +- stl/inc/tuple | 18 ++--- stl/inc/type_traits | 12 ++-- stl/inc/utility | 16 ++--- stl/inc/valarray | 4 +- stl/inc/variant | 16 ++--- stl/inc/vector | 12 ++-- stl/inc/xbit_ops.h | 2 +- stl/inc/xlocale | 14 ++-- stl/inc/xlocmes | 6 +- stl/inc/xlocmon | 14 ++-- stl/inc/xlocnum | 18 ++--- stl/inc/xloctime | 18 ++--- stl/inc/xmemory | 32 ++++----- stl/inc/xpolymorphic_allocator.h | 2 +- stl/inc/xstring | 30 ++++---- stl/inc/xthreads.h | 2 +- stl/inc/xtimec.h | 2 +- stl/inc/xtr1common | 4 +- stl/inc/xutility | 114 +++++++++++++++---------------- stl/inc/yvals.h | 10 +-- stl/inc/yvals_core.h | 20 +++--- stl/src/atomic_wait.cpp | 2 +- stl/src/filesystem.cpp | 10 +-- stl/src/locale0.cpp | 2 +- stl/src/pplerror.cpp | 2 +- stl/src/raisehan.cpp | 2 +- stl/src/syserror.cpp | 2 +- stl/src/vector_algorithms.cpp | 2 +- stl/src/xmtx.cpp | 4 +- 76 files changed, 399 insertions(+), 399 deletions(-) diff --git a/stl/inc/__msvc_cxx_stdatomic.hpp b/stl/inc/__msvc_cxx_stdatomic.hpp index f4c7749229..3757ea7ca9 100644 --- a/stl/inc/__msvc_cxx_stdatomic.hpp +++ b/stl/inc/__msvc_cxx_stdatomic.hpp @@ -13,13 +13,13 @@ // provide a specific error message for C compilers, before the general error message in yvals_core.h #ifndef __cplusplus #error <__msvc_cxx_stdatomic.hpp> is an internal header. It is incompatible with C and should not be directly included. -#endif // __cplusplus +#endif // !defined(__cplusplus) #include #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #if !_HAS_CXX23 _EMIT_STL_WARNING(STL4038, "The contents of are available only with C++23 or later."); @@ -64,7 +64,7 @@ using _STD atomic_ullong; #ifdef __cpp_lib_char8_t using _STD atomic_char8_t; -#endif // __cpp_lib_char8_t +#endif // defined(__cpp_lib_char8_t) using _STD atomic_char16_t; using _STD atomic_char32_t; diff --git a/stl/inc/__msvc_filebuf.hpp b/stl/inc/__msvc_filebuf.hpp index 55d409f77c..fb1a54813b 100644 --- a/stl/inc/__msvc_filebuf.hpp +++ b/stl/inc/__msvc_filebuf.hpp @@ -67,7 +67,7 @@ extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, #ifdef _CRTBLD extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const unsigned short*, ios_base::openmode, int); -#endif // _CRTBLD +#endif // defined(_CRTBLD) template bool _Fgetc(_Elem& _Ch, FILE* _File) { // get an element from a C stream @@ -107,7 +107,7 @@ inline bool _Fgetc(unsigned short& _Wchar, FILE* _File) { // get an unsigned sho return true; } } -#endif // _CRTBLD +#endif // defined(_CRTBLD) template bool _Fputc(_Elem _Ch, FILE* _File) { // put an element to a C stream @@ -129,7 +129,7 @@ template <> inline bool _Fputc(unsigned short _Wchar, FILE* _File) { // put an unsigned short element to a C stream return _CSTD fputwc(_Wchar, _File) != WEOF; } -#endif // _CRTBLD +#endif // defined(_CRTBLD) template bool _Ungetc(const _Elem&, FILE*) { // put back an arbitrary element to a C stream (always fail) @@ -161,7 +161,7 @@ template <> inline bool _Ungetc(const unsigned short& _Wchar, FILE* _File) { // put back an unsigned short element to a C stream return _CSTD ungetwc(_Wchar, _File) != WEOF; } -#endif // _CRTBLD +#endif // defined(_CRTBLD) _EXPORT_STD template class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer associated with a C stream @@ -379,7 +379,7 @@ class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer return open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _CRTBLD +#endif // defined(_CRTBLD) basic_filebuf* close() { basic_filebuf* _Ans; diff --git a/stl/inc/__msvc_iter_core.hpp b/stl/inc/__msvc_iter_core.hpp index 169245b3a9..edb4328074 100644 --- a/stl/inc/__msvc_iter_core.hpp +++ b/stl/inc/__msvc_iter_core.hpp @@ -510,7 +510,7 @@ struct iterator_traits : _Iterator_traits_base<_Iter> {}; // get traits from ite template struct iterator_traits<_Ty*> : _Iterator_traits_pointer_base<_Ty> {}; // get traits from pointer, if possible -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _STD_END #pragma pop_macro("new") diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 466fbf2573..13a34eb9cb 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -241,7 +241,7 @@ namespace ranges { }; #endif // _HAS_CXX23 } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _Fn for_each(_InIt _First, _InIt _Last, _Fn _Func) { // perform function for each element [_First, _Last) @@ -360,7 +360,7 @@ namespace ranges { _EXPORT_STD inline constexpr _For_each_n_fn for_each_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_CXX17 _EXPORT_STD template = 0> @@ -481,7 +481,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Count_fn count{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _Iter_diff_t<_InIt> count_if(_InIt _First, _InIt _Last, _Pr _Pred) { @@ -545,7 +545,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Count_if_fn count_if{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch(_InIt1 _First1, const _InIt1 _Last1, _InIt2 _First2, _Pr _Pred) { @@ -741,7 +741,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Equal_fn equal{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred) { @@ -1109,7 +1109,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Is_permutation_fn is_permutation{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool all_of(_InIt _First, _InIt _Last, _Pr _Pred) { // test if all elements satisfy _Pred @@ -1170,7 +1170,7 @@ namespace ranges { _EXPORT_STD inline constexpr _All_of_fn all_of{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool any_of(const _InIt _First, const _InIt _Last, _Pr _Pred) { @@ -1232,7 +1232,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Any_of_fn any_of{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool none_of(const _InIt _First, const _InIt _Last, _Pr _Pred) { @@ -1418,7 +1418,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Copy_backward_fn copy_backward{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred) { // copy each satisfying _Pred @@ -1599,7 +1599,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Move_backward_fn move_backward{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 pair<_OutIt1, _OutIt2> partition_copy( @@ -1704,7 +1704,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partition_copy_fn partition_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -1788,7 +1788,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Is_partitioned_fn is_partitioned{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt partition_point(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { @@ -1910,7 +1910,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partition_point_fn partition_point{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _NODISCARD _CONSTEXPR20 bool _Equal_rev_pred_unchecked(_InIt1 _First1, _InIt2 _First2, const _InIt2 _Last2, _Pr _Pred) { @@ -2955,7 +2955,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Find_last_if_fn find_last_if_not{_Not_quite_object::_Construct_tag{}}; #endif // _HAS_CXX23 } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt1 find_end( @@ -3218,7 +3218,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Find_end_fn find_end{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt1 find_first_of( @@ -3413,7 +3413,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Swap_ranges_fn swap_ranges{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _FwdIt2 swap_ranges(const _FwdIt1 _First1, const _FwdIt1 _Last1, _FwdIt2 _First2) { @@ -3593,7 +3593,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Transform_fn transform{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 void replace(const _FwdIt _First, const _FwdIt _Last, const _Ty& _Oldval, const _Ty& _Newval) { @@ -3668,7 +3668,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Replace_fn replace{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 void replace_if(const _FwdIt _First, const _FwdIt _Last, _Pr _Pred, const _Ty& _Val) { @@ -3741,7 +3741,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Replace_if_fn replace_if{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt replace_copy(_InIt _First, _InIt _Last, _OutIt _Dest, const _Ty& _Oldval, const _Ty& _Newval) { @@ -3835,7 +3835,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Replace_copy_fn replace_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt replace_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred, const _Ty& _Val) { @@ -4038,7 +4038,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Generate_n_fn generate_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 void generate(_FwdIt _First, _FwdIt _Last, _Fn _Func) { // replace [_First, _Last) with _Func() @@ -4381,7 +4381,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Remove_copy_if_fn remove_copy_if{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD_UNIQUE_ALG _CONSTEXPR20 _FwdIt unique(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { @@ -4494,7 +4494,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Unique_fn unique{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template #ifdef __cpp_lib_concepts @@ -4752,7 +4752,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Reverse_fn reverse{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt reverse_copy(_BidIt _First, _BidIt _Last, _OutIt _Dest) { @@ -4890,7 +4890,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Reverse_copy_fn reverse_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 #ifdef __cpp_lib_concepts @@ -5000,7 +5000,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Rotate_fn rotate{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt rotate_copy(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last, _OutIt _Dest) { @@ -5077,7 +5077,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Rotate_copy_fn rotate_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -5339,7 +5339,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Sample_fn sample{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -5427,7 +5427,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Shuffle_fn shuffle{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_AUTO_PTR_ETC _EXPORT_STD template @@ -5953,7 +5953,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partition_fn partition{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -6322,7 +6322,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Stable_partition_fn stable_partition{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 void _Push_heap_by_index( @@ -6429,7 +6429,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Push_heap_fn push_heap{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 void _Pop_heap_hole_by_index( @@ -6591,7 +6591,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Pop_heap_fn pop_heap{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 void _Make_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { @@ -6665,7 +6665,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Make_heap_fn make_heap{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 _RanIt _Is_heap_until_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { @@ -6813,7 +6813,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Is_heap_until_fn is_heap_until{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -6991,7 +6991,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Upper_bound_fn upper_bound{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Pr _Pred) { @@ -7097,7 +7097,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Equal_range_fn equal_range{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool binary_search(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Pr _Pred) { @@ -7146,7 +7146,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Binary_search_fn binary_search{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _NODISCARD constexpr _Distance_unknown _Idl_dist_add(_Distance_unknown, _Distance_unknown) { return {}; @@ -7316,7 +7316,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Merge_fn merge{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 // The "usual invariants" for the inplace_merge helpers below are: @@ -7903,7 +7903,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Inplace_merge_fn inplace_merge{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 _BidIt _Insertion_sort_unchecked(const _BidIt _First, const _BidIt _Last, _Pr _Pred) { @@ -8301,7 +8301,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Sort_fn sort{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _Ty* _Uninitialized_merge_move(_FwdIt _First, const _FwdIt _Mid, const _FwdIt _Last, _Ty* const _Dest, _Pr _Pred) { @@ -8747,7 +8747,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Stable_sort_fn stable_sort{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pred) { @@ -8866,7 +8866,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partial_sort_fn partial_sort{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9014,7 +9014,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partial_sort_copy_fn partial_sort_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9136,7 +9136,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Nth_element_fn nth_element{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9260,7 +9260,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Includes_fn includes{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9399,7 +9399,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Set_union_fn set_union{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9532,7 +9532,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Set_intersection_fn set_intersection{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9662,7 +9662,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Set_difference_fn set_difference{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9815,7 +9815,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Set_symmetric_difference_fn set_symmetric_difference{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -10005,7 +10005,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Minmax_element_fn minmax_element{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -10207,7 +10207,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Minmax_fn minmax{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 bool next_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { @@ -10311,7 +10311,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Next_permutation_fn next_permutation{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 bool prev_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { @@ -10415,7 +10415,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Prev_permutation_fn prev_permutation{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt is_sorted_until(const _FwdIt _First, _FwdIt _Last, _Pr _Pred) { @@ -10531,7 +10531,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Is_sorted_until_fn is_sorted_until{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, const _Ty& _Max_val, _Pr _Pred) { @@ -10676,7 +10676,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Lexicographical_compare_fn lexicographical_compare{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _STD_END diff --git a/stl/inc/array b/stl/inc/array index 026e04268b..b1b2186599 100644 --- a/stl/inc/array +++ b/stl/inc/array @@ -34,7 +34,7 @@ class _Array_const_iterator public: #ifdef __cpp_lib_concepts using iterator_concept = contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) using iterator_category = random_access_iterator_tag; using value_type = _Ty; using difference_type = ptrdiff_t; @@ -307,7 +307,7 @@ public: #ifdef __cpp_lib_concepts using iterator_concept = contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) using iterator_category = random_access_iterator_tag; using value_type = _Ty; using difference_type = ptrdiff_t; diff --git a/stl/inc/atomic b/stl/inc/atomic index dd8e0c08c9..b96a87d0fa 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -70,7 +70,7 @@ extern "C" _NODISCARD char __stdcall __std_atomic_has_cmpxchg16b() noexcept; #define ATOMIC_CHAR_LOCK_FREE 2 #ifdef __cpp_lib_char8_t #define ATOMIC_CHAR8_T_LOCK_FREE 2 -#endif // __cpp_lib_char8_t +#endif // defined(__cpp_lib_char8_t) #define ATOMIC_CHAR16_T_LOCK_FREE 2 #define ATOMIC_CHAR32_T_LOCK_FREE 2 #define ATOMIC_WCHAR_T_LOCK_FREE 2 @@ -1375,7 +1375,7 @@ struct _Atomic_storage<_Ty&, 16> { // lock-free using 16-byte intrinsics typename _Atomic_storage_types<_Ty&>::_TStorage _Storage; }; -#endif // _WIN64 +#endif // defined(_WIN64) template struct _Atomic_integral; // not defined @@ -2774,7 +2774,7 @@ _EXPORT_STD using atomic_ullong = atomic; #ifdef __cpp_lib_char8_t _EXPORT_STD using atomic_char8_t = atomic; -#endif // __cpp_lib_char8_t +#endif // defined(__cpp_lib_char8_t) _EXPORT_STD using atomic_char16_t = atomic; _EXPORT_STD using atomic_char32_t = atomic; _EXPORT_STD using atomic_wchar_t = atomic; diff --git a/stl/inc/barrier b/stl/inc/barrier index edbcc5d74c..0714b8b447 100644 --- a/stl/inc/barrier +++ b/stl/inc/barrier @@ -11,7 +11,7 @@ #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #if !_HAS_CXX20 _EMIT_STL_WARNING(STL4038, "The contents of are available only with C++20 or later."); @@ -72,7 +72,7 @@ public: static_assert( #ifndef __cpp_noexcept_function_type is_function_v> || -#endif // __cpp_noexcept_function_type +#endif // defined(__cpp_noexcept_function_type) is_nothrow_invocable_v<_Completion_function&>, "N4950 [thread.barrier.class]/5: is_nothrow_invocable_v shall be true"); diff --git a/stl/inc/chrono b/stl/inc/chrono index 0cd14b3cd1..5225a0701c 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -36,7 +36,7 @@ #include #include #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX20 #pragma pack(push, _CRT_PACKING) @@ -1918,7 +1918,7 @@ namespace chrono { const time_zone& _Left, const time_zone& _Right) noexcept { return _Left.name() <=> _Right.name(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) // [time.zone.leap] @@ -2009,7 +2009,7 @@ namespace chrono { const leap_second& _Left, const leap_second& _Right) noexcept { return _Left.date() <=> _Right.date(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) // [time.zone.link] @@ -2042,7 +2042,7 @@ namespace chrono { const time_zone_link& _Left, const time_zone_link& _Right) noexcept { return _Left.name() <=> _Right.name(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) // [time.zone.db] @@ -5988,7 +5988,7 @@ namespace chrono { return _STD move(_Os).str(); } } // namespace chrono -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) inline namespace literals { inline namespace chrono_literals { diff --git a/stl/inc/compare b/stl/inc/compare index 1d984a91bf..f929885b80 100644 --- a/stl/inc/compare +++ b/stl/inc/compare @@ -844,7 +844,7 @@ inline namespace _Cpos { _EXPORT_STD inline constexpr _Compare_partial_order_fallback::_Cpo compare_partial_order_fallback; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _STD_END #pragma pop_macro("new") diff --git a/stl/inc/complex b/stl/inc/complex index ce60701b76..2ba1720ff1 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -158,13 +158,13 @@ namespace _Float_multi_prec { _mm_store_sd(&_Result, _Mresult); return _Result; } -#endif // _FMP_USING_X86_X64_INTRINSICS +#endif // defined(_FMP_USING_X86_X64_INTRINSICS) #ifdef _FMP_USING_STD_FMA _NODISCARD inline double _Sqr_error_std_fma(const double _Xval, const double _Prod0) noexcept { return _STD fma(_Xval, _Xval, -_Prod0); } -#endif // _FMP_USING_STD_FMA +#endif // defined(_FMP_USING_STD_FMA) // square(1x precision) -> 2x precision // the result is exact when no internal overflow or underflow occurs diff --git a/stl/inc/concepts b/stl/inc/concepts index 15845cb6d7..0d577be892 100644 --- a/stl/inc/concepts +++ b/stl/inc/concepts @@ -30,7 +30,7 @@ concept _Same_impl = // Must be a distinct concept to provide symmetric subsumpt __is_same(_Ty1, _Ty2); #else // ^^^ use intrinsic / no intrinsic vvv is_same_v<_Ty1, _Ty2>; -#endif // __clang__ +#endif // ^^^ no intrinsic ^^^ _EXPORT_STD template concept same_as = _Same_impl<_Ty1, _Ty2> && _Same_impl<_Ty2, _Ty1>; @@ -297,6 +297,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _STL_COMPILER_PREPROCESSOR #endif // _CONCEPTS_ diff --git a/stl/inc/coroutine b/stl/inc/coroutine index 9a9d16e113..6694fe41b3 100644 --- a/stl/inc/coroutine +++ b/stl/inc/coroutine @@ -19,7 +19,7 @@ _EMIT_STL_WARNING(STL4038, "The contents of are available only with #else // ^^^ is not available / is available vvv #ifndef _ALLOW_COROUTINE_ABI_MISMATCH #pragma detect_mismatch("_COROUTINE_ABI", "2") -#endif // _ALLOW_COROUTINE_ABI_MISMATCH +#endif // defined(_ALLOW_COROUTINE_ABI_MISMATCH) #if _HAS_CXX20 #include @@ -165,7 +165,7 @@ _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>( return compare_three_way{}(_Left.address(), _Right.address()); #else // ^^^ no workaround / workaround vvv return _Left.address() <=> _Right.address(); -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) } #else // ^^^ <=> exists / <=> does not exist vvv _NODISCARD constexpr bool operator!=(const coroutine_handle<> _Left, const coroutine_handle<> _Right) noexcept { @@ -265,6 +265,6 @@ _STL_RESTORE_CLANG_WARNINGS #pragma pack(pop) #endif // is available -#endif // _RESUMABLE_FUNCTIONS_SUPPORTED +#endif // ^^^ no /await ^^^ #endif // _STL_COMPILER_PREPROCESSOR #endif // _COROUTINE_ diff --git a/stl/inc/csignal b/stl/inc/csignal index 5eba45955a..e1a93d5b5c 100644 --- a/stl/inc/csignal +++ b/stl/inc/csignal @@ -23,7 +23,7 @@ _EXPORT_STD using _CSTD sig_atomic_t; _EXPORT_STD using _CSTD raise; #ifndef _M_CEE_PURE _EXPORT_STD using _CSTD signal; -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) _STD_END #pragma pop_macro("new") diff --git a/stl/inc/cstddef b/stl/inc/cstddef index 756b2316b3..bd0605567b 100644 --- a/stl/inc/cstddef +++ b/stl/inc/cstddef @@ -95,7 +95,7 @@ _EXPORT_STD template , int> _NODISCARD _MSVC_INTRINSIC constexpr _IntType to_integer(const byte _Arg) noexcept { return static_cast<_IntType>(_Arg); } -#endif // __cpp_lib_byte +#endif // defined(__cpp_lib_byte) _STD_END diff --git a/stl/inc/exception b/stl/inc/exception index c4aa6b6cf0..6c36670d6b 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -49,7 +49,7 @@ _EXPORT_STD _NODISCARD inline terminate_handler __CRTDECL get_terminate() noexce // get current terminate handler return _get_terminate(); } -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #if _HAS_UNEXPECTED using ::unexpected; @@ -62,7 +62,7 @@ _NODISCARD inline unexpected_handler __CRTDECL get_unexpected() noexcept { // get current unexpected handler return _get_unexpected(); } -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #endif // _HAS_UNEXPECTED _STD_END @@ -304,12 +304,12 @@ private: #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" -#endif // __clang__ +#endif // defined(__clang__) void* _Data1{}; void* _Data2{}; #ifdef __clang__ #pragma clang diagnostic pop -#endif // __clang__ +#endif // defined(__clang__) }; _EXPORT_STD _NODISCARD inline exception_ptr current_exception() noexcept { diff --git a/stl/inc/execution b/stl/inc/execution index c21b4de8db..7518bed526 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -277,7 +277,7 @@ struct _Parallelism_allocate_traits { return _Result; } -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) }; template diff --git a/stl/inc/expected b/stl/inc/expected index ce22ebf67e..60d8bd38ab 100644 --- a/stl/inc/expected +++ b/stl/inc/expected @@ -329,7 +329,7 @@ public: constexpr ~expected() #ifndef __clang__ // TRANSITION, LLVM-59854 noexcept -#endif // __clang__ +#endif // defined(__clang__) { if (_Has_value) { if constexpr (!is_trivially_destructible_v<_Ty>) { @@ -1258,7 +1258,7 @@ public: constexpr ~expected() #ifndef __clang__ // TRANSITION, LLVM-59854 noexcept -#endif // __clang__ +#endif // defined(__clang__) { if (!_Has_value) { _Unexpected.~_Err(); diff --git a/stl/inc/experimental/coroutine b/stl/inc/experimental/coroutine index 8b5549681c..e0796b771e 100644 --- a/stl/inc/experimental/coroutine +++ b/stl/inc/experimental/coroutine @@ -34,7 +34,7 @@ headers do not support Clang, but the C++20 header does. #ifdef __cpp_impl_coroutine #error The and headers are only supported with \ /await and implement pre-C++20 coroutine support. Use for standard C++20 coroutines. -#endif // __cpp_impl_coroutine +#endif // defined(__cpp_impl_coroutine) // intrinsics used in implementation of coroutine_handle extern "C" size_t _coro_resume(void*); diff --git a/stl/inc/experimental/filesystem b/stl/inc/experimental/filesystem index 0d98d73dcc..0c6add7f32 100644 --- a/stl/inc/experimental/filesystem +++ b/stl/inc/experimental/filesystem @@ -28,13 +28,13 @@ _STL_DISABLE_CLANG_WARNINGS #error The header providing std::experimental::filesystem is deprecated by Microsoft \ and will be REMOVED. It is superseded by the C++17 header providing std::filesystem. \ You can define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING to suppress this error. -#endif // _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING +#endif // defined(_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING) #pragma warning(disable : 4365) // conversion from 'type_1' to 'type_2', signed/unsigned mismatch (/Wall) #ifndef _FS_DLL #define _FS_DLL extern "C" _CRTIMP2_PURE -#endif // _FS_DLL +#endif // defined(_FS_DLL) #define _MAX_FILESYS_NAME 260 // longest Windows or Posix filename + 1 diff --git a/stl/inc/experimental/generator b/stl/inc/experimental/generator index 9294c2993e..79b6857bd4 100644 --- a/stl/inc/experimental/generator +++ b/stl/inc/experimental/generator @@ -39,7 +39,7 @@ namespace experimental { const _Ty* _Value; #ifdef _CPPUNWIND exception_ptr _Exception; -#endif // _CPPUNWIND +#endif // defined(_CPPUNWIND) generator get_return_object() noexcept { return generator{*this}; @@ -60,8 +60,8 @@ namespace experimental { } #else // ^^^ defined(_CPPUNWIND) / !defined(_CPPUNWIND) vvv void unhandled_exception() noexcept {} -#endif // _CPPUNWIND -#endif // _KERNEL_MODE +#endif // defined(_CPPUNWIND) +#endif // defined(_KERNEL_MODE) #ifdef _CPPUNWIND void _Rethrow_if_exception() { @@ -69,7 +69,7 @@ namespace experimental { _STD rethrow_exception(_Exception); } } -#endif // _CPPUNWIND +#endif // defined(_CPPUNWIND) suspend_always yield_value(const _Ty& _Val) noexcept { _Value = _STD addressof(_Val); diff --git a/stl/inc/filesystem b/stl/inc/filesystem index 799fb8df23..17b4400c56 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -154,7 +154,7 @@ namespace filesystem { else if constexpr (is_same_v<_EcharT, char8_t>) { return _Convert_wide_to_narrow<_Traits>(__std_code_page::_Utf8, _Input, _Al); } -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) else if constexpr (is_same_v<_EcharT, char32_t>) { return _Convert_wide_to_utf32<_Traits>(_Input, _Al); } else { // wchar_t, char16_t @@ -216,7 +216,7 @@ namespace filesystem { const string_view _Input_as_char{reinterpret_cast(_Input.data()), _Input.size()}; return _Convert_narrow_to_wide(__std_code_page::_Utf8, _Input_as_char); } -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) template _NODISCARD wstring _Convert_stringoid_to_wide(const u16string_view _Input, _Conversion) { @@ -2693,7 +2693,7 @@ namespace filesystem { _NODISCARD bool operator==(default_sentinel_t) const noexcept { return !_Impl; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _Directory_entry_proxy operator++(int) { _Directory_entry_proxy _Proxy(**this); @@ -2949,7 +2949,7 @@ namespace filesystem { _NODISCARD bool operator==(default_sentinel_t) const noexcept { return !_Impl; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _Directory_entry_proxy operator++(int) { _Directory_entry_proxy _Proxy(**this); @@ -4415,7 +4415,7 @@ namespace ranges { template <> inline constexpr bool enable_view = true; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _STD_END diff --git a/stl/inc/format b/stl/inc/format index fdcf65e790..8cd8ba117a 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -3947,6 +3947,6 @@ _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _STL_COMPILER_PREPROCESSOR #endif // _FORMAT_ diff --git a/stl/inc/fstream b/stl/inc/fstream index 6d19f9800e..f54be2d492 100644 --- a/stl/inc/fstream +++ b/stl/inc/fstream @@ -69,7 +69,7 @@ public: _Myios::setstate(ios_base::failbit); } } -#endif // _CRTBLD +#endif // defined(_CRTBLD) explicit basic_ifstream(FILE* _File) : _Mybase(_STD addressof(_Filebuffer)), _Filebuffer(_File) {} // extension @@ -156,7 +156,7 @@ public: open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _CRTBLD +#endif // defined(_CRTBLD) __CLR_OR_THIS_CALL ~basic_ifstream() noexcept override {} @@ -252,7 +252,7 @@ public: _Myios::setstate(ios_base::failbit); } } -#endif // _CRTBLD +#endif // defined(_CRTBLD) explicit basic_ofstream(FILE* _File) : _Mybase(_STD addressof(_Filebuffer)), _Filebuffer(_File) {} // extension @@ -339,7 +339,7 @@ public: open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _CRTBLD +#endif // defined(_CRTBLD) __CLR_OR_THIS_CALL ~basic_ofstream() noexcept override {} @@ -440,7 +440,7 @@ public: _Myios::setstate(ios_base::failbit); } } -#endif // _CRTBLD +#endif // defined(_CRTBLD) explicit basic_fstream(FILE* _File) : _Mybase(_STD addressof(_Filebuffer)), _Filebuffer(_File) {} // extension @@ -528,7 +528,7 @@ public: open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _CRTBLD +#endif // defined(_CRTBLD) __CLR_OR_THIS_CALL ~basic_fstream() noexcept override {} diff --git a/stl/inc/functional b/stl/inc/functional index 028651736d..a03d80fbab 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -15,12 +15,12 @@ #if _HAS_CXX17 #ifdef _LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY #include -#endif // _LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY +#endif // defined(_LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY) #include #endif // _HAS_CXX17 #ifdef __cpp_lib_concepts #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) @@ -1007,7 +1007,7 @@ _NON_MEMBER_CALL(_GET_FUNCTION_IMPL, X1, X2, X3) }; _NON_MEMBER_CALL(_GET_FUNCTION_IMPL_NOEXCEPT, X1, X2, X3) #undef _GET_FUNCTION_IMPL_NOEXCEPT -#endif // __cpp_noexcept_function_type +#endif // defined(__cpp_noexcept_function_type) _EXPORT_STD template class function : public _Get_function_impl<_Fty>::type { // wrapper for callable objects @@ -1298,7 +1298,7 @@ void __stdcall _Function_destroy_large(_Move_only_function_data& _Self) noexcept if constexpr (alignof(_Vt) > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { ::operator delete(static_cast(_Pfn), align_val_t{alignof(_Vt)}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { ::operator delete(static_cast(_Pfn)); } @@ -1322,7 +1322,7 @@ _NODISCARD void* _Function_new_large(_CTypes&&... _Args) { if constexpr (alignof(_Vt) > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { ::operator delete(_Ptr, align_val_t{alignof(_Vt)}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { ::operator delete(_Ptr); } @@ -1335,7 +1335,7 @@ _NODISCARD void* _Function_new_large(_CTypes&&... _Args) { if constexpr (alignof(_Vt) > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { _Ptr = ::operator new(sizeof(_Vt), align_val_t{alignof(_Vt)}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { _Ptr = ::operator new(sizeof(_Vt)); } @@ -1745,7 +1745,7 @@ public: return this->_Get_invoke()(this->_Data, _STD forward<_Types>(_Args)...); } }; -#endif // __cpp_noexcept_function_type +#endif // defined(__cpp_noexcept_function_type) _EXPORT_STD template class move_only_function : private _Move_only_function_call<_Signature...> { @@ -3124,7 +3124,7 @@ namespace ranges { using is_transparent = int; }; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_TR1_NAMESPACE namespace _DEPRECATE_TR1_NAMESPACE tr1 { diff --git a/stl/inc/ios b/stl/inc/ios index 486b0c8991..9e5cf9b53c 100644 --- a/stl/inc/ios +++ b/stl/inc/ios @@ -179,7 +179,7 @@ template class _CRTIMP2_PURE_IMPORT basic_ios>; #ifdef __FORCE_INSTANCE template class _CRTIMP2_PURE_IMPORT basic_ios>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) _EXPORT_STD inline ios_base& __CLRCALL_OR_CDECL boolalpha(ios_base& _Iosbase) { // set boolalpha diff --git a/stl/inc/iosfwd b/stl/inc/iosfwd index a8b715f43a..5911be77a7 100644 --- a/stl/inc/iosfwd +++ b/stl/inc/iosfwd @@ -72,7 +72,7 @@ public: _DEPRECATE_FPOS_SEEKPOS fpos_t seekpos() const noexcept { return {}; } -#endif // _REMOVE_FPOS_SEEKPOS +#endif // defined(_REMOVE_FPOS_SEEKPOS) _NODISCARD streamoff operator-(const fpos& _Right) const noexcept /* strengthened */ { return static_cast(*this) - static_cast(_Right); @@ -140,7 +140,7 @@ _EXPORT_STD using streampos = fpos<_Mbstatet>; _EXPORT_STD using wstreampos = streampos; #ifdef __cpp_lib_char8_t _EXPORT_STD using u8streampos = streampos; -#endif // __cpp_lib_char8_t +#endif // defined(__cpp_lib_char8_t) _EXPORT_STD using u16streampos = streampos; _EXPORT_STD using u32streampos = streampos; @@ -155,7 +155,7 @@ struct char_traits; #ifdef __cpp_char8_t template <> struct char_traits; -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) template <> struct char_traits; template <> @@ -165,7 +165,7 @@ struct char_traits; #ifdef _CRTBLD template <> struct char_traits; -#endif // _CRTBLD +#endif // defined(_CRTBLD) _EXPORT_STD template class allocator; diff --git a/stl/inc/iostream b/stl/inc/iostream index 2d0fb25f32..736c0cb658 100644 --- a/stl/inc/iostream +++ b/stl/inc/iostream @@ -63,7 +63,7 @@ public: private: __PURE_APPDOMAIN_GLOBAL static int _Init_cnt; }; -#endif // _CRTBLD +#endif // defined(_CRTBLD) #endif // ^^^ !defined(_M_CEE_PURE) ^^^ _STD_END diff --git a/stl/inc/istream b/stl/inc/istream index fa7b2342cf..f7c52c3eb9 100644 --- a/stl/inc/istream +++ b/stl/inc/istream @@ -171,7 +171,7 @@ public: _Pfn(*this); return *this; } -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) basic_istream& __CLR_OR_THIS_CALL operator>>(basic_istream&(__cdecl* _Pfn)(basic_istream&) ) { // call basic_istream manipulator @@ -708,7 +708,7 @@ inline basic_istream>& __CLR_OR_THIS char_traits>::operator>>(unsigned short& _Ch) { // extract a character return _STD operator>>(*this, _Ch); } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // defined(_NATIVE_WCHAR_T_DEFINED) #if defined(_DLL_CPPLIB) @@ -719,7 +719,7 @@ template class _CRTIMP2_PURE_IMPORT basic_istream> #ifdef __FORCE_INSTANCE template class _CRTIMP2_PURE_IMPORT basic_istream>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) _EXPORT_STD extern "C++" template @@ -772,7 +772,7 @@ template class _CRTIMP2_PURE_IMPORT basic_iostream #ifdef __FORCE_INSTANCE template class _CRTIMP2_PURE_IMPORT basic_iostream>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) template @@ -855,7 +855,7 @@ template basic_istream& operator>>(basic_istream& _Istr, unsigned char* _Str) { return _Istream_extract_into_buffer(_Istr, SIZE_MAX, reinterpret_cast(_Str)); } -#endif // _HAS_CXX20 +#endif // ^^^ !_HAS_CXX20 ^^^ _EXPORT_STD template basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, _Elem& _Ch) { // extract a character diff --git a/stl/inc/iterator b/stl/inc/iterator index 48089f6d0a..5b4e52efd1 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -33,7 +33,7 @@ public: using difference_type = ptrdiff_t; #else using difference_type = void; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _CONSTEXPR20 explicit back_insert_iterator(_Container& _Cont) noexcept /* strengthened */ : container(_STD addressof(_Cont)) {} @@ -84,7 +84,7 @@ public: using difference_type = ptrdiff_t; #else using difference_type = void; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _CONSTEXPR20 explicit front_insert_iterator(_Container& _Cont) : container(_STD addressof(_Cont)) {} @@ -135,7 +135,7 @@ public: #else // ^^^ implementing Ranges / no Ranges vvv using difference_type = void; using _Wrapped_iter = typename _Container::iterator; -#endif // __cpp_lib_concepts +#endif // ^^^ no Ranges ^^^ _CONSTEXPR20 insert_iterator(_Container& _Cont, _Wrapped_iter _Where) : container(_STD addressof(_Cont)), iter(_STD move(_Where)) {} @@ -231,7 +231,7 @@ public: private: _Se _Last{}; }; -#endif // __cpp_lib_concepts +#endif // ^^^ Ranges ^^^ _EXPORT_STD template , class _Diff = ptrdiff_t> class istream_iterator { @@ -254,7 +254,7 @@ public: #ifdef __cpp_lib_concepts constexpr istream_iterator(default_sentinel_t) noexcept( is_nothrow_default_constructible_v<_Ty>) /* strengthened */ {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) istream_iterator(istream_type& _Istr) : _Myistr(_STD addressof(_Istr)) { _Getval(); @@ -289,7 +289,7 @@ public: _NODISCARD_FRIEND bool operator==(const istream_iterator& _Left, default_sentinel_t) noexcept /* strengthened */ { return !_Left._Myistr; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) private: void _Getval() { // get a _Ty value if possible @@ -379,7 +379,7 @@ public: constexpr istreambuf_iterator() noexcept : _Strbuf(nullptr), _Got(true), _Val() {} #ifdef __cpp_lib_concepts constexpr istreambuf_iterator(default_sentinel_t) noexcept : _Strbuf(nullptr), _Got(true), _Val() {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) istreambuf_iterator(istream_type& _Istr) noexcept : _Strbuf(_Istr.rdbuf()), _Got(!_Strbuf), _Val() {} @@ -456,7 +456,7 @@ public: return !_Left._Strbuf; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) private: void _Inc() { // skip to next input element @@ -1462,7 +1462,7 @@ template struct iterator_traits> : iterator_traits<_Iter> { using pointer = conditional_t, add_pointer_t>, void>; }; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _STD_END @@ -1484,7 +1484,7 @@ public: using reference = _Pointee_type&; #ifdef __cpp_lib_concepts using iterator_concept = _STD contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) constexpr checked_array_iterator() = default; @@ -1698,7 +1698,7 @@ public: using reference = _Pointee_type&; #ifdef __cpp_lib_concepts using iterator_concept = _STD contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) constexpr unchecked_array_iterator() = default; diff --git a/stl/inc/limits b/stl/inc/limits index ac59bbaf2c..ed957a566f 100644 --- a/stl/inc/limits +++ b/stl/inc/limits @@ -359,7 +359,7 @@ public: static constexpr int digits = 8; static constexpr int digits10 = 2; }; -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) template <> class numeric_limits : public _Num_int_base { diff --git a/stl/inc/locale b/stl/inc/locale index bb80b9ed53..39eed7412a 100644 --- a/stl/inc/locale +++ b/stl/inc/locale @@ -119,7 +119,7 @@ private: #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdllimport-static-field-def" -#endif // __clang__ +#endif // defined(__clang__) template __PURE_APPDOMAIN_GLOBAL locale::id collate<_Elem>::id; @@ -133,12 +133,12 @@ template __PURE_APPDOMAIN_GLOBAL locale::id collate::id; #ifdef __FORCE_INSTANCE template __PURE_APPDOMAIN_GLOBAL locale::id collate::id; -#endif // __FORCE_INSTANCE +#endif // defined(___FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) #ifdef __clang__ #pragma clang diagnostic pop -#endif // __clang__ +#endif // defined(__clang__) _EXPORT_STD template class collate_byname : public collate<_Elem> { // collate for named locale diff --git a/stl/inc/memory b/stl/inc/memory index 2ce7556cf3..fbd6021ef9 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -123,7 +123,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_copy_fn uninitialized_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NoThrowFwdIt uninitialized_copy_n(const _InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) { @@ -217,7 +217,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_copy_n_fn uninitialized_copy_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_CXX17 _EXPORT_STD template @@ -278,7 +278,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_move_fn uninitialized_move{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template pair<_InIt, _NoThrowFwdIt> uninitialized_move_n(_InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) { @@ -437,7 +437,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_fill_fn uninitialized_fill{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NoThrowFwdIt uninitialized_fill_n(_NoThrowFwdIt _First, const _Diff _Count_raw, const _Tval& _Val) { @@ -567,7 +567,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Destroy_at_fn destroy_at{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_CXX17 _EXPORT_STD template @@ -621,7 +621,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Destroy_fn destroy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _NoThrowFwdIt destroy_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { @@ -679,7 +679,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Destroy_n_fn destroy_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template void uninitialized_default_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { @@ -751,7 +751,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_default_construct_fn uninitialized_default_construct{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NoThrowFwdIt uninitialized_default_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { @@ -812,7 +812,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_default_construct_n_fn uninitialized_default_construct_n{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template void uninitialized_value_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { @@ -885,7 +885,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_value_construct_fn uninitialized_value_construct{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NoThrowFwdIt uninitialized_value_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { @@ -935,7 +935,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_value_construct_n_fn uninitialized_value_construct_n{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 #if _HAS_CXX20 @@ -959,7 +959,7 @@ public: using difference_type = ptrdiff_t; #else using difference_type = void; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) using pointer = void; using reference = void; @@ -1136,7 +1136,7 @@ private: #else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv virtual void _Destroy() noexcept = 0; // destroy managed resource virtual void _Delete_this() noexcept = 0; // destroy self -#endif // defined(_M_CEE_PURE) +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ _Atomic_counter_t _Uses = 1; _Atomic_counter_t _Weaks = 1; @@ -2168,7 +2168,7 @@ _NODISCARD _Refc* _Allocate_flexible_array(const size_t _Count) { if constexpr (_Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { return static_cast<_Refc*>(::operator new(_Bytes, align_val_t{_Align})); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { return static_cast<_Refc*>(::operator new(_Bytes)); } @@ -2181,7 +2181,7 @@ void _Deallocate_flexible_array(_Refc* const _Ptr) noexcept { if constexpr (_Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { ::operator delete(static_cast(_Ptr), align_val_t{_Align}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { ::operator delete(static_cast(_Ptr)); } @@ -3544,7 +3544,7 @@ _NODISCARD compare_three_way_result_t::pointer, // clang-format on return _Left.get() <=> _Right.get(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator==(const unique_ptr<_Ty, _Dx>& _Left, nullptr_t) noexcept { @@ -3617,7 +3617,7 @@ _NODISCARD _CONSTEXPR23 compare_three_way_result_t const unique_ptr<_Ty, _Dx>& _Left, nullptr_t) { return _Left.get() <=> static_cast::pointer>(nullptr); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template struct _Can_stream_unique_ptr : false_type {}; diff --git a/stl/inc/memory_resource b/stl/inc/memory_resource index 4504977750..f7c76c7ace 100644 --- a/stl/inc/memory_resource +++ b/stl/inc/memory_resource @@ -19,7 +19,7 @@ _EMIT_STL_WARNING(STL4038, "The contents of are available only #ifndef _M_CEE_PURE #include -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) @@ -367,7 +367,7 @@ namespace pmr { // no room for header + alignment padding; this memory WAS NOT allocated by this pool resource #ifdef _DEBUG _STL_REPORT_ERROR("Cannot deallocate memory not allocated by this memory pool."); -#endif // _DEBUG +#endif // defined(_DEBUG) } _Oversized_header* _Hdr = reinterpret_cast<_Oversized_header*>(static_cast(_Ptr) + _Bytes) - 1; @@ -591,7 +591,7 @@ namespace pmr { private: mutable mutex _Mtx; }; -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) _EXPORT_STD class monotonic_buffer_resource : public _Identity_equal_resource { public: diff --git a/stl/inc/new b/stl/inc/new index bd88e23366..94f1503f84 100644 --- a/stl/inc/new +++ b/stl/inc/new @@ -65,7 +65,7 @@ _EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, _STD align_val_t, _EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, _STD align_val_t) noexcept; _EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, size_t, _STD align_val_t) noexcept; _EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, _STD align_val_t, const _STD nothrow_t&) noexcept; -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) _EXPORT_STD extern "C++" _NODISCARD void* __CRTDECL operator new(size_t, void*) noexcept; _EXPORT_STD extern "C++" _NODISCARD void* __CRTDECL operator new[](size_t, void*) noexcept; @@ -73,7 +73,7 @@ _EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, void*) noexcept; _EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, void*) noexcept; #pragma warning(pop) -#endif // _BUILD_STD_MODULE +#endif // defined(_BUILD_STD_MODULE) _STD_BEGIN #if _HAS_EXCEPTIONS diff --git a/stl/inc/optional b/stl/inc/optional index 8d1684f87a..ae1edb8184 100644 --- a/stl/inc/optional +++ b/stl/inc/optional @@ -613,7 +613,7 @@ public: return _STD forward<_Fn>(_Func)(); } } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 using _Mybase::reset; @@ -629,7 +629,7 @@ _NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const optional requires requires { { *_Left == *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -646,7 +646,7 @@ _NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const optional requires requires { { *_Left != *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -663,7 +663,7 @@ _NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const optional< requires requires { { *_Left < *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -680,7 +680,7 @@ _NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const optional< requires requires { { *_Left > *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -697,7 +697,7 @@ _NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const optional requires requires(const _Ty1& _Elem1, const _Ty2& _Elem2) { { *_Left <= *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -714,7 +714,7 @@ _NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const optional requires requires { { *_Left >= *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -736,7 +736,7 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> operator<=>(const op return _Left_has_value <=> _Right_has_value; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD constexpr bool operator==(const optional<_Ty>& _Left, nullopt_t) noexcept { @@ -945,7 +945,7 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> return strong_ordering::less; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template && is_swappable_v<_Ty>, int> = 0> _CONSTEXPR20 void swap(optional<_Ty>& _Left, optional<_Ty>& _Right) noexcept(noexcept(_Left.swap(_Right))) { diff --git a/stl/inc/ostream b/stl/inc/ostream index 5651775c46..859f58093e 100644 --- a/stl/inc/ostream +++ b/stl/inc/ostream @@ -680,7 +680,7 @@ template class _CRTIMP2_PURE_IMPORT basic_ostream> #ifdef __FORCE_INSTANCE template class _CRTIMP2_PURE_IMPORT basic_ostream>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) _EXPORT_STD template @@ -960,7 +960,7 @@ _EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char8_t) = delete; _EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char8_t) = delete; -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) #if !_HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 #ifdef _NATIVE_WCHAR_T_DEFINED @@ -1286,7 +1286,7 @@ void println(ostream&, format_string<_Types...>, _Types&&...) = delete; // requi _EXPORT_STD void vprint_unicode(ostream&, string_view, format_args) = delete; // requires /GR option _EXPORT_STD void vprint_nonunicode(ostream&, string_view, format_args) = delete; // requires /GR option #endif // ^^^ !defined(_CPPRTTI) ^^^ -#endif // __cpp_lib_print +#endif // defined(__cpp_lib_print) _STD_END diff --git a/stl/inc/print b/stl/inc/print index 184392ccb3..9ce4ad9cbd 100644 --- a/stl/inc/print +++ b/stl/inc/print @@ -166,6 +166,6 @@ _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#endif // __cpp_lib_print +#endif // defined(__cpp_lib_print) #endif // _STL_COMPILER_PREPROCESSOR #endif // _PRINT_ diff --git a/stl/inc/queue b/stl/inc/queue index 3ce80378b8..abfb9cc3aa 100644 --- a/stl/inc/queue +++ b/stl/inc/queue @@ -52,7 +52,7 @@ public: #ifdef __cpp_lib_concepts template <_Container_compatible_range<_Ty> _Rng> queue(from_range_t, _Rng&& _Range) : c(_RANGES to<_Container>(_STD forward<_Rng>(_Range))) {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 template , int> = 0> @@ -86,7 +86,7 @@ public: template <_Container_compatible_range<_Ty> _Rng, class _Alloc> queue(from_range_t, _Rng&& _Range, const _Alloc& _Al) : c(_RANGES to<_Container>(_STD forward<_Rng>(_Range), _Al)) {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _NODISCARD_EMPTY_ADAPTOR_MEMBER bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ { @@ -177,7 +177,7 @@ template <_RANGES input_range _Rng, class _Alloc = allocator<_RANGES range_value enable_if_t<_Is_allocator<_Alloc>::value, int> = 0> queue(from_range_t, _Rng&&, _Alloc = _Alloc()) -> queue<_RANGES range_value_t<_Rng>, deque<_RANGES range_value_t<_Rng>, _Alloc>>; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _EXPORT_STD template @@ -216,7 +216,7 @@ _NODISCARD compare_three_way_result_t<_Container> operator<=>( const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) { return _Left._Get_container() <=> _Right._Get_container(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template ::value, int> = 0> void swap(queue<_Ty, _Container>& _Left, queue<_Ty, _Container>& _Right) noexcept(noexcept(_Left.swap(_Right))) { diff --git a/stl/inc/ranges b/stl/inc/ranges index fe82e88999..6ad3f34f3f 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -10484,7 +10484,7 @@ namespace ranges { _NODISCARD constexpr auto to(_Types&&... _Args) { return _Range_closure<_To_template_fn<_Container>, decay_t<_Types>...>{_STD forward<_Types>(_Args)...}; } -#endif // __cpp_lib_ranges_to_container +#endif // defined(__cpp_lib_ranges_to_container) #endif // _HAS_CXX23 } // namespace ranges @@ -10496,6 +10496,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#endif // __cpp_lib_ranges +#endif // defined(__cpp_lib_ranges) #endif // _STL_COMPILER_PREPROCESSOR #endif // _RANGES_ diff --git a/stl/inc/regex b/stl/inc/regex index 25290396a4..ed4b9918fa 100644 --- a/stl/inc/regex +++ b/stl/inc/regex @@ -2469,7 +2469,7 @@ public: _NODISCARD bool operator==(default_sentinel_t) const { return !_MyRe; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _NODISCARD const value_type& operator*() const { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -2662,7 +2662,7 @@ public: _NODISCARD bool operator==(default_sentinel_t) const { return !_Res; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _NODISCARD const value_type& operator*() const { #if _ITERATOR_DEBUG_LEVEL != 0 diff --git a/stl/inc/semaphore b/stl/inc/semaphore index 33797c2f9f..04c8c70a94 100644 --- a/stl/inc/semaphore +++ b/stl/inc/semaphore @@ -11,7 +11,7 @@ #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #if !_HAS_CXX20 _EMIT_STL_WARNING(STL4038, "The contents of are available only with C++20 or later."); diff --git a/stl/inc/shared_mutex b/stl/inc/shared_mutex index dfc004bb0c..75cf2fc0c9 100644 --- a/stl/inc/shared_mutex +++ b/stl/inc/shared_mutex @@ -11,7 +11,7 @@ #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #include #include diff --git a/stl/inc/span b/stl/inc/span index a5264cd36c..e6919d0e1d 100644 --- a/stl/inc/span +++ b/stl/inc/span @@ -32,7 +32,7 @@ template struct _Span_iterator { #ifdef __cpp_lib_concepts using iterator_concept = contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) using iterator_category = random_access_iterator_tag; using value_type = remove_cv_t<_Ty>; using difference_type = ptrdiff_t; @@ -688,7 +688,7 @@ _NODISCARD auto as_writable_bytes(span<_Ty, _Extent> _Sp) noexcept { using _ReturnType = span; return _ReturnType{reinterpret_cast(_Sp.data()), _Sp.size_bytes()}; } -#endif // __cpp_lib_byte +#endif // defined(__cpp_lib_byte) _STD_END diff --git a/stl/inc/spanstream b/stl/inc/spanstream index 73d9f24d1f..c5572a180b 100644 --- a/stl/inc/spanstream +++ b/stl/inc/spanstream @@ -13,7 +13,7 @@ _EMIT_STL_WARNING(STL4038, "The contents of are available only with #else // ^^^ !_HAS_CXX23 / _HAS_CXX23 vvv #ifdef __cpp_lib_concepts #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #include #include #include @@ -225,7 +225,7 @@ public: : basic_ispanstream( _STD span<_Elem>{const_cast<_Elem*>(_RANGES data(_Range)), static_cast(_RANGES size(_Range))}) {} // clang-format on -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) basic_ispanstream& operator=(const basic_ispanstream&) = delete; @@ -264,7 +264,7 @@ public: _STD span<_Elem>{const_cast<_Elem*>(_RANGES data(_Range)), static_cast(_RANGES size(_Range))}); } // clang-format on -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) private: _Mysb _Buf; diff --git a/stl/inc/stack b/stl/inc/stack index a007be90b5..c2432fcb47 100644 --- a/stl/inc/stack +++ b/stl/inc/stack @@ -50,7 +50,7 @@ public: #ifdef __cpp_lib_concepts template <_Container_compatible_range<_Ty> _Rng> stack(from_range_t, _Rng&& _Range) : c(_RANGES to<_Container>(_STD forward<_Rng>(_Range))) {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 template , int> = 0> @@ -84,7 +84,7 @@ public: template <_Container_compatible_range<_Ty> _Rng, class _Alloc> stack(from_range_t, _Rng&& _Range, const _Alloc& _Al) : c(_RANGES to<_Container>(_STD forward<_Rng>(_Range), _Al)) {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _NODISCARD_EMPTY_ADAPTOR_MEMBER bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ { @@ -168,7 +168,7 @@ stack(from_range_t, _Rng&&) -> stack<_RANGES range_value_t<_Rng>>; template <_RANGES input_range _Rng, class _Alloc, enable_if_t<_Is_allocator<_Alloc>::value, int> = 0> stack(from_range_t, _Rng&&, _Alloc) -> stack<_RANGES range_value_t<_Rng>, deque<_RANGES range_value_t<_Rng>, _Alloc>>; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _EXPORT_STD template @@ -207,7 +207,7 @@ _NODISCARD compare_three_way_result_t<_Container> operator<=>( const stack<_Ty, _Container>& _Left, const stack<_Ty, _Container>& _Right) { return _Left._Get_container() <=> _Right._Get_container(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template ::value, int> = 0> void swap(stack<_Ty, _Container>& _Left, stack<_Ty, _Container>& _Right) noexcept(noexcept(_Left.swap(_Right))) { diff --git a/stl/inc/streambuf b/stl/inc/streambuf index 76cc33db52..5226485e2a 100644 --- a/stl/inc/streambuf +++ b/stl/inc/streambuf @@ -408,7 +408,7 @@ template class _CRTIMP2_PURE_IMPORT basic_streambuf>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) _STD_END diff --git a/stl/inc/thread b/stl/inc/thread index 6d8f83c026..5f6e80c0d3 100644 --- a/stl/inc/thread +++ b/stl/inc/thread @@ -20,7 +20,7 @@ #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/tuple b/stl/inc/tuple index 8059fbaed0..bd604aeb59 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -10,7 +10,7 @@ #if _STL_COMPILER_PREPROCESSOR #ifdef __cpp_lib_concepts #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #include <__msvc_iter_core.hpp> #include @@ -196,7 +196,7 @@ concept _Can_construct_from_tuple_like = && (tuple_size_v<_Tuple> != 1 || (!is_convertible_v<_TupleLike, tuple_element_t<0, _Tuple>> && !is_constructible_v, _TupleLike>) ); -#endif // __clang__ +#endif // defined(__clang__) template >> struct _Three_way_comparison_result_with_tuple_like {}; @@ -205,7 +205,7 @@ template requires #ifndef __clang__ // TRANSITION, DevCom-10265237 (sizeof...(_TTypes) == sizeof...(_Indices)) && -#endif // __clang__ +#endif // defined(__clang__) (requires { typename _Synth_three_way_result<_TTypes, tuple_element_t<_Indices, _UTuple>>; } && ...) struct _Three_way_comparison_result_with_tuple_like, _UTuple, index_sequence<_Indices...>> { using type = common_comparison_category_t<_Synth_three_way_result<_TTypes, tuple_element_t<_Indices, _UTuple>>...>; @@ -268,7 +268,7 @@ public: constexpr const tuple& operator=(_Other&&) const noexcept /* strengthened */ { return *this; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _CONSTEXPR20 void swap(tuple&) noexcept {} @@ -441,11 +441,11 @@ public: && (1 + sizeof...(_Rest) == tuple_size_v>) && _Can_construct_values_from_tuple_like_v && (sizeof...(_Rest) != 0 || (!is_convertible_v<_Other, _This> && !is_constructible_v<_This, _Other>) ) -#endif // __clang__ +#endif // defined(__clang__) constexpr explicit(_Is_tuple_like_constructor_explicit_v<_Other>) tuple(_Other&& _Right) : tuple(_Unpack_tuple_t{}, _STD forward<_Other>(_Right)) { } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 template >) && _Can_construct_values_from_tuple_like_v && (sizeof...(_Rest) != 0 || (!is_convertible_v<_Other, _This> && !is_constructible_v<_This, _Other>) ) -#endif // __clang__ +#endif // ^^^ no workaround ^^^ constexpr explicit(_Is_tuple_like_constructor_explicit_v<_Other>) tuple(allocator_arg_t, const _Alloc& _Al, _Other&& _Right) : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD forward<_Other>(_Right)) { } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 tuple& operator=(const volatile tuple&) = delete; @@ -731,7 +731,7 @@ public: _Assign_tuple_like(_STD forward<_Other>(_Right), make_index_sequence<1 + sizeof...(_Rest)>{}); return *this; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _CONSTEXPR20 void swap(tuple& _Right) noexcept( diff --git a/stl/inc/type_traits b/stl/inc/type_traits index a9bb2159ab..e5f27930cc 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -555,7 +555,7 @@ _CLASS_DEFINE_CV_REF_NOEXCEPT(_IS_MEMFUNPTR_ELLIPSIS) _NON_MEMBER_CALL(_IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES, , , ) #ifdef __cpp_noexcept_function_type _NON_MEMBER_CALL(_IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES, , , noexcept) -#endif // __cpp_noexcept_function_type +#endif // defined(__cpp_noexcept_function_type) #undef _IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES #endif // _HAS_CXX23 && !defined(__clang__) @@ -1599,7 +1599,7 @@ const _Ty* addressof(const _Ty&&) = delete; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-volatile" -#endif // __clang__ +#endif // defined(__clang__) template _NODISCARD _Ty _Fake_copy_init(_Ty) noexcept; @@ -1610,7 +1610,7 @@ _NODISCARD _Ty _Fake_copy_init(_Ty) noexcept; #ifdef __clang__ #pragma clang diagnostic pop -#endif // __clang__ +#endif // defined(__clang__) #pragma warning(pop) @@ -1953,7 +1953,7 @@ _EXPORT_STD template @@ -2229,7 +2229,7 @@ _INLINE_VAR constexpr bool _Is_trivially_swappable_v = conjunction_v inline constexpr bool _Is_trivially_swappable_v = true; -#endif // __cpp_lib_byte +#endif // defined(__cpp_lib_byte) template struct _Is_trivially_swappable : bool_constant<_Is_trivially_swappable_v<_Ty>> { @@ -2264,7 +2264,7 @@ template class _TyQual, template { using type = common_reference_t>; }; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #define _BITMASK_OPS(_MAYBE_EXPORT, _BITMASK) \ _MAYBE_EXPORT _NODISCARD constexpr _BITMASK operator&(_BITMASK _Left, _BITMASK _Right) noexcept { \ diff --git a/stl/inc/utility b/stl/inc/utility index ca2d4543b0..67a21b3fd8 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -13,7 +13,7 @@ #ifdef __cpp_lib_concepts #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_CXX20 #include @@ -215,9 +215,9 @@ template concept _Can_construct_from_pair_like = _Pair_like<_PairLike> && !_Is_subrange_v> && is_constructible_v<_Ty1, decltype(_STD get<0>(_STD declval<_PairLike>()))> && is_constructible_v<_Ty2, decltype(_STD get<1>(_STD declval<_PairLike>()))>; -#endif // __clang__ +#endif // defined(__clang__) #endif // _HAS_CXX23 -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template struct pair { // store a pair of values @@ -295,14 +295,14 @@ struct pair { // store a pair of values requires conjunction_v>>, is_constructible<_Ty1, decltype(_STD get<0>(_STD declval<_Other>()))>, is_constructible<_Ty2, decltype(_STD get<1>(_STD declval<_Other>()))>> -#endif // __clang__ +#endif // ^^^ no workaround ^^^ constexpr explicit(!conjunction_v(_STD declval<_Other>())), _Ty1>, is_convertible(_STD declval<_Other>())), _Ty2>>) pair(_Other&& _Right) noexcept(is_nothrow_constructible_v<_Ty1, decltype(_STD get<0>(_STD declval<_Other>()))>&& is_nothrow_constructible_v<_Ty2, decltype(_STD get<1>(_STD declval<_Other>()))>) // strengthened : first(_STD get<0>(_STD forward<_Other>(_Right))), second(_STD get<1>(_STD forward<_Other>(_Right))) { } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 template @@ -439,7 +439,7 @@ struct pair { // store a pair of values second = _STD get<1>(_STD forward<_Other>(_Right)); return *this; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _CONSTEXPR20 void swap(pair& _Right) noexcept( @@ -803,7 +803,7 @@ inline constexpr bool _Is_standard_integer = is_integral_v<_Ty> #endif // _NATIVE_WCHAR_T_DEFINED #ifdef __cpp_char8_t char8_t, -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) char16_t, char32_t>; _EXPORT_STD template @@ -925,7 +925,7 @@ _EXPORT_STD [[noreturn]] __forceinline void unreachable() noexcept /* strengthen _STL_UNREACHABLE; #ifdef _DEBUG _CSTD abort(); // likely to be called in debug mode, but can't be relied upon - already entered the UB territory -#endif // _DEBUG +#endif // defined(_DEBUG) } _EXPORT_STD template diff --git a/stl/inc/valarray b/stl/inc/valarray index 6d21bec64e..8a9d8636fc 100644 --- a/stl/inc/valarray +++ b/stl/inc/valarray @@ -46,7 +46,7 @@ _Ty* _Allocate_for_op_delete(size_t _Count) { if constexpr (_Extended_alignment) { return static_cast<_Ty*>(::operator new(_Bytes, align_val_t{alignof(_Ty)})); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { return static_cast<_Ty*>(::operator new(_Bytes)); } @@ -565,7 +565,7 @@ private: if constexpr (_Extended_alignment) { ::operator delete(static_cast(_Myptr), align_val_t{alignof(_Ty)}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { ::operator delete(static_cast(_Myptr)); } diff --git a/stl/inc/variant b/stl/inc/variant index 0f5a596899..bd862b78d2 100644 --- a/stl/inc/variant +++ b/stl/inc/variant @@ -150,7 +150,7 @@ template