Skip to content

Commit

Permalink
external: adapt tests to Corrade changes.
Browse files Browse the repository at this point in the history
Now C++17 is properly selected on MSVC, but the __cplusplus macro isn't
doing the right thing there. Use CORRADE_CXX_STANDARD instead.
  • Loading branch information
mosra committed Jan 9, 2018
1 parent 080cd46 commit 18822ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/MagnumExternal/Optional/OptionalWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/* Cover your eyes. This will hurt. And wash your hands after. */
#ifdef MAGNUM_BUILD_DEPRECATED
#ifdef __has_include
#if __has_include(<optional>) && __cplusplus >= 201703L
#if __has_include(<optional>) && CORRADE_CXX_STANDARD >= 201703L
#define _MAGNUM_HAS_STD_OPTIONAL
#include <optional>

Expand Down
4 changes: 2 additions & 2 deletions src/MagnumExternal/Optional/Test/StdOptionalTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ void StdOptionalTest::conversion() {
Debug{} << "Using C++ version" << __cplusplus;
#ifdef _MAGNUM_HAS_STD_OPTIONAL
Debug{} << "Using a conversion to std::optional, C++17 should be present";
CORRADE_VERIFY(__cplusplus >= 201703L);
CORRADE_VERIFY(CORRADE_CXX_STANDARD >= 201703L);
#else
Debug{} << "Using a typedef to std::optional, C++17 should not be present";
CORRADE_VERIFY(__cplusplus < 201703L);
CORRADE_VERIFY(CORRADE_CXX_STANDARD < 201703L);
#endif

Containers::Optional<int> a{5};
Expand Down

0 comments on commit 18822ee

Please sign in to comment.