Add wxCHECK_CXX_STD() and use it to test for C++17 and C++20

Unlike direct tests of __cplusplus, using this macro also works with
(recent enough, i.e. MSVS 2015.3 or later) MSVC versions, even if
/Zc:__cplusplus is not used.

This simplifies some checks and makes some other ones (notably the check
for C++20 used before wxALLOW_COMBINING_ENUMS macro definition) work
with MSVC versions with C++20 support as intended.
This commit is contained in:
Vadim Zeitlin
2022-05-11 16:57:18 +01:00
parent d311a07b7a
commit 2ba9007d0e
6 changed files with 46 additions and 8 deletions

View File

@@ -133,7 +133,7 @@ static void TestAssertHandler(const wxString& file,
// so we'd just die without any useful information -- abort instead.
abortReason << assertMessage << wxASCII_STR(" in a worker thread.");
}
#if __cplusplus >= 201703L || wxCHECK_VISUALC_VERSION(14)
#if wxCHECK_CXX_STD(201703L)
else if ( uncaught_exceptions() )
#else
else if ( uncaught_exception() )