RapidFuzz
Loading...
Searching...
No Matches
config.hpp
1/* SPDX-License-Identifier: MIT */
2/* Copyright © 2020 Max Bachmann */
3
4#pragma once
5
6#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
7# 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
19# define RAPIDFUZZ_IF_CONSTEXPR_AVAILABLE 1
20# define RAPIDFUZZ_IF_CONSTEXPR if constexpr
21#else
22# define RAPIDFUZZ_IF_CONSTEXPR_AVAILABLE 0
23# define RAPIDFUZZ_IF_CONSTEXPR if
24#endif
25
26#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) || __cplusplus >= 201402L)
27# define RAPIDFUZZ_CONSTEXPR_CXX14 constexpr
28#else
29# define RAPIDFUZZ_CONSTEXPR_CXX14 inline
30#endif