Skip to content

Commit

Permalink
Use _MSVC_LANG instead of __cplusplus in MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
mogemimi committed Sep 17, 2024
1 parent 9f5e168 commit bae87d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pomdog/utility/spin_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ namespace pomdog::detail {

class POMDOG_EXPORT SpinLock final {
std::atomic_flag flag_;
#if defined(_MSC_VER) && defined(_MSVC_LANG)
// NOTE: https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
static_assert(_MSVC_LANG >= 202002L, "ATOMIC_FLAG_INIT was deprecated in C++20, https://cplusplus.github.io/LWG/issue3659");
#else
static_assert(__cplusplus >= 202002L, "ATOMIC_FLAG_INIT was deprecated in C++20, https://cplusplus.github.io/LWG/issue3659");
#endif

public:
SpinLock() noexcept;
Expand Down

0 comments on commit bae87d3

Please sign in to comment.