Skip to content

Commit 3bfc9c6

Browse files
committed
fix compilation on old msvc versions
1 parent a6bd162 commit 3bfc9c6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

rapidfuzz/details/config.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55

66
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
77
# define RAPIDFUZZ_DEDUCTION_GUIDES
8+
#endif
9+
10+
/* older versions of msvc have bugs in their if constexpr support
11+
* see https://github.com/rapidfuzz/rapidfuzz-cpp/issues/122
12+
* since we don't know the exact version this was fixed in, use the earliest we could test
13+
*/
14+
#if defined(_MSC_VER) && _MSC_VER < 1920
15+
# define RAPIDFUZZ_IF_CONSTEXPR_AVAILABLE 0
16+
# define RAPIDFUZZ_IF_CONSTEXPR if
17+
#elif ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
18+
# define RAPIDFUZZ_DEDUCTION_GUIDES
819
# define RAPIDFUZZ_IF_CONSTEXPR_AVAILABLE 1
920
# define RAPIDFUZZ_IF_CONSTEXPR if constexpr
1021
#else

0 commit comments

Comments
 (0)