Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update preprocessor #else comment in product code to clarify which mode is where #3900

Merged
merged 38 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
62bd0c5
Towards #351. Product headers
AlexGuteniev Jul 22, 2023
0638513
delete unneeded file
AlexGuteniev Jul 22, 2023
23c37e3
copypasta typo
AlexGuteniev Jul 22, 2023
e31f650
also defined
AlexGuteniev Jul 22, 2023
6b9e0a3
missing defined(...)
AlexGuteniev Jul 22, 2023
7536cff
More defined(...)
AlexGuteniev Jul 22, 2023
9c08d62
-whitespace
AlexGuteniev Jul 22, 2023
f263910
More defined(...)
AlexGuteniev Jul 22, 2023
808a52d
More defined(...)
AlexGuteniev Jul 22, 2023
6b3ffb2
source
AlexGuteniev Jul 22, 2023
d1cf6fb
-whitespace
AlexGuteniev Jul 22, 2023
5c91788
-whitespace
AlexGuteniev Jul 22, 2023
ea3863e
More defined(...)
AlexGuteniev Jul 22, 2023
de8f8b4
defined(...)
AlexGuteniev Jul 22, 2023
fcc21a0
some `#endif` s
AlexGuteniev Jul 22, 2023
c1095b9
-whitespace
AlexGuteniev Jul 22, 2023
d0a1573
some `#endif`
AlexGuteniev Jul 22, 2023
24dbd33
Pre-existing: `not _USE_STD_VECTOR_ALGORITHMS` => `!_USE_STD_VECTOR_A…
StephanTLavavej Jul 24, 2023
6419e16
Pre-existing: Simplify `_HAS_CXX20` comments in `<coroutine>`.
StephanTLavavej Jul 24, 2023
c580468
Pre-existing: `^^^ / vvv` => `/`
StephanTLavavej Jul 24, 2023
cfe31ab
`^^^ / vvv` => `/`
StephanTLavavej Jul 24, 2023
e3c7d77
Fix `!!defined(__AVX2__)` typos.
StephanTLavavej Jul 24, 2023
4cbb7d2
Fix `_CPPUNWIND` arrow comment.
StephanTLavavej Jul 24, 2023
b87d693
Extra space: `// defined(_CPPUNWIND)` => `// defined(_CPPUNWIND)`
StephanTLavavej Jul 24, 2023
da43a31
Nested preprocessor logic should always be commented.
StephanTLavavej Jul 24, 2023
1393a0b
Update `#ifdef __cpp_lib_concepts` comments (mostly pre-existing).
StephanTLavavej Jul 24, 2023
62823d9
Fix `_CMPXCHG_MASK_OUT_PADDING_BITS` arrow comment.
StephanTLavavej Jul 24, 2023
7f9c537
Consistent arrow comments.
StephanTLavavej Jul 24, 2023
2f6d3d9
Add missing spaces.
StephanTLavavej Jul 24, 2023
bf5512a
After `#ifndef`, comment `!defined`.
StephanTLavavej Jul 24, 2023
fdaf2d8
Typo: `___FORCE_INSTANCE` had 3 underscores.
StephanTLavavej Jul 24, 2023
dc69b4e
Drop an unnecessary empty line.
StephanTLavavej Jul 24, 2023
1388496
Fix arrow comment.
StephanTLavavej Jul 24, 2023
f763e0a
Within `_HAS_CXX20`, note that we have a workaround for lacking conce…
StephanTLavavej Jul 24, 2023
d97c495
Fix comments that should have said `defined`; use the shorter `warnin…
StephanTLavavej Jul 24, 2023
7b59b51
Non-comment style changes to align with comments: Always use parenthe…
StephanTLavavej Jul 24, 2023
0211211
Merge remote-tracking branch 'upstream/main' into modes
AlexGuteniev Jul 26, 2023
d1b0f47
Merge branch 'main' into modes
StephanTLavavej Aug 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions stl/inc/__msvc_bit_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(__lzcnt64(_Val));
#endif // _M_IX86
#endif // ^^^ !defined(_M_IX86) ^^^
}
}

Expand All @@ -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<int>(_Digits - 1 - _Result);
}
Expand All @@ -128,14 +128,14 @@ template <class _Ty>
_NODISCARD int _Checked_x86_x64_countl_zero(const _Ty _Val) noexcept {
#ifdef __AVX2__
return _Countl_zero_lzcnt(_Val);
#else // __AVX2__
#else // ^^^ defined(__AVX2__) ^^^ / vvv !defined(__AVX2__) vvv
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
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__) ^^^
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
}
#endif // defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC))

Expand Down Expand Up @@ -251,9 +251,9 @@ _NODISCARD int _Countr_zero_tzcnt(const _Ty _Val) noexcept {
} else {
return static_cast<int>(_TZCNT_U32(_Low));
}
#else // ^^^ _M_IX86 / !_M_IX86 vvv
#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv
return static_cast<int>(_TZCNT_U64(_Val));
#endif // _M_IX86
#endif // ^^^ !defined(_M_IX86) ^^^
}
}

Expand Down Expand Up @@ -286,11 +286,11 @@ _NODISCARD int _Countr_zero_bsf(const _Ty _Val) noexcept {
} else {
return static_cast<int>(_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<int>(_Result);
}
Expand All @@ -299,14 +299,14 @@ template <class _Ty>
_NODISCARD int _Checked_x86_x64_countr_zero(const _Ty _Val) noexcept {
#ifdef __AVX2__
return _Countr_zero_tzcnt(_Val);
#else // __AVX2__
#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
Expand All @@ -329,9 +329,9 @@ _NODISCARD int _Unchecked_x86_x64_popcount(const _Ty _Val) noexcept {
} else {
#ifdef _M_IX86
return static_cast<int>(__popcnt(_Val >> 32) + __popcnt(static_cast<unsigned int>(_Val)));
#else // ^^^ _M_IX86 / !_M_IX86 vvv
#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv
return static_cast<int>(__popcnt64(_Val));
#endif // _M_IX86
#endif // ^^^ !defined(_M_IX86) ^^^
}
}

Expand Down
6 changes: 3 additions & 3 deletions stl/inc/__msvc_cxx_stdatomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <yvals.h>

#ifdef _M_CEE_PURE
#error <stdatomic.h> 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 <stdatomic.h> are available only with C++23 or later.");
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions stl/inc/__msvc_filebuf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <class _Elem>
bool _Fgetc(_Elem& _Ch, FILE* _File) { // get an element from a C stream
Expand Down Expand Up @@ -107,7 +107,7 @@ inline bool _Fgetc(unsigned short& _Wchar, FILE* _File) { // get an unsigned sho
return true;
}
}
#endif // _CRTBLD
#endif // defined(_CRTBLD)

template <class _Elem>
bool _Fputc(_Elem _Ch, FILE* _File) { // put an element to a C stream
Expand All @@ -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 <class _Elem>
bool _Ungetc(const _Elem&, FILE*) { // put back an arbitrary element to a C stream (always fail)
Expand Down Expand Up @@ -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 _Elem, class _Traits>
class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer associated with a C stream
Expand Down Expand Up @@ -379,7 +379,7 @@ class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer
return open(_Filename, static_cast<ios_base::openmode>(_Mode));
}
#endif // _HAS_OLD_IOSTREAMS_MEMBERS
#endif // _CRTBLD
#endif // defined(_CRTBLD)

basic_filebuf* close() {
basic_filebuf* _Ans;
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/__msvc_iter_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ struct iterator_traits : _Iterator_traits_base<_Iter> {}; // get traits from ite

template <class _Ty>
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")
Expand Down
Loading