From f67f94117f21c71b0af03abbf9cdd7561f45893d Mon Sep 17 00:00:00 2001 From: Alvin Wong Date: Wed, 23 Nov 2022 22:32:58 +0800 Subject: [PATCH 1/2] cmake: Fix WindowsNumerics check --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 495b3b508..19ce748a7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -30,7 +30,7 @@ function(TestHasWindowsnumerics OUTPUT_VARNAME) include(CheckCXXSourceCompiles) check_cxx_source_compiles(" #define _WINDOWS_NUMERICS_NAMESPACE_ winrt::Windows::Foundation::Numerics -#define _WINDOWS_NUMERICS_BEGIN_NAMESPACE_ WINRT_EXPORT namespace winrt::Windows::Foundation::Numerics +#define _WINDOWS_NUMERICS_BEGIN_NAMESPACE_ namespace winrt::Windows::Foundation::Numerics #define _WINDOWS_NUMERICS_END_NAMESPACE_ #include int main() {} From 1221175be74c4c03825b7f407137a1936276bf24 Mon Sep 17 00:00:00 2001 From: Alvin Wong Date: Wed, 23 Nov 2022 22:51:46 +0800 Subject: [PATCH 2/2] Guard cpp20 format and ranges tests behind feature test macros --- test/test_cpp20/format.cpp | 3 +++ test/test_cpp20/ranges.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/test_cpp20/format.cpp b/test/test_cpp20/format.cpp index 69da0d0c1..0c40a4113 100644 --- a/test/test_cpp20/format.cpp +++ b/test/test_cpp20/format.cpp @@ -1,4 +1,6 @@ #include "pch.h" + +#ifdef __cpp_lib_format #include struct stringable : winrt::implements @@ -37,3 +39,4 @@ TEST_CASE("format") } #endif } +#endif diff --git a/test/test_cpp20/ranges.cpp b/test/test_cpp20/ranges.cpp index 9bf88a579..9df542696 100644 --- a/test/test_cpp20/ranges.cpp +++ b/test/test_cpp20/ranges.cpp @@ -1,4 +1,6 @@ #include "pch.h" + +#ifdef __cpp_lib_ranges #include #include @@ -46,3 +48,4 @@ TEST_CASE("ranges") REQUIRE((result == std::vector{ 2, 4, 6 })); } } +#endif