From 5334e2ba947e5f606cab63446730198e31d6038d Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Sun, 28 Jan 2024 10:55:02 -0500 Subject: [PATCH] fix --- tests/CMakeLists.txt | 1 + tests/fast_int.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 26e4368..a7c8342 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -72,6 +72,7 @@ fast_float_add_cpp_test(long_test) fast_float_add_cpp_test(powersoffive_hardround) fast_float_add_cpp_test(string_test) fast_float_add_cpp_test(fast_int) +target_compile_features(fast_int PRIVATE cxx_std_17) fast_float_add_cpp_test(json_fmt) fast_float_add_cpp_test(fortran) diff --git a/tests/fast_int.cpp b/tests/fast_int.cpp index 0783371..8ef7784 100644 --- a/tests/fast_int.cpp +++ b/tests/fast_int.cpp @@ -1,3 +1,4 @@ +#if defined(__cplusplus) && (__cplusplus >= 201703L) #include #include #include @@ -741,4 +742,10 @@ int main() { } return EXIT_SUCCESS; -} \ No newline at end of file +} +#else +int main() { + std::cerr << "The test requires C++17." << std::endl; + return EXIT_SUCCESS; +} +#endif \ No newline at end of file