Skip to content

Commit 325c723

Browse files
committed
MSVC compilation fix.
1 parent e88d9ae commit 325c723

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/basictest.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
#endif // #ifndef FASTFLOAT_CONSTEXPR_TESTS
2222
#endif // FASTFLOAT_IS_CONSTEXPR
2323

24+
// MSVC's constexpr evaluation and some constexpr-friendly std library pieces
25+
// (like i/o and certain std::numeric_limits members) aren't suitable for the
26+
// compile-time tests in this file on MSVC; disable the constexpr tests when
27+
// compiling with MSVC (but allow them for clang/clang-cl).
28+
#if defined(_MSC_VER) && !defined(__clang__)
29+
# ifdef FASTFLOAT_CONSTEXPR_TESTS
30+
# undef FASTFLOAT_CONSTEXPR_TESTS
31+
# endif
32+
#endif
33+
2434
#if FASTFLOAT_HAS_BIT_CAST
2535
#include <bit>
2636
#endif

0 commit comments

Comments
 (0)