File: config.hpp

package info (click to toggle)
rapidfuzz-cpp 3.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,480 kB
  • sloc: cpp: 30,893; python: 63; makefile: 26; sh: 8
file content (30 lines) | stat: -rw-r--r-- 1,060 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* SPDX-License-Identifier: MIT */
/* Copyright © 2020 Max Bachmann */

#pragma once

#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
#    define RAPIDFUZZ_DEDUCTION_GUIDES
#endif

/* older versions of msvc have bugs in their if constexpr support
 * see https://github.com/rapidfuzz/rapidfuzz-cpp/issues/122
 * since we don't know the exact version this was fixed in, use the earliest we could test
 */
#if defined(_MSC_VER) && _MSC_VER < 1920
#    define RAPIDFUZZ_IF_CONSTEXPR_AVAILABLE 0
#    define RAPIDFUZZ_IF_CONSTEXPR if
#elif ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
#    define RAPIDFUZZ_DEDUCTION_GUIDES
#    define RAPIDFUZZ_IF_CONSTEXPR_AVAILABLE 1
#    define RAPIDFUZZ_IF_CONSTEXPR if constexpr
#else
#    define RAPIDFUZZ_IF_CONSTEXPR_AVAILABLE 0
#    define RAPIDFUZZ_IF_CONSTEXPR if
#endif

#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) || __cplusplus >= 201402L)
#    define RAPIDFUZZ_CONSTEXPR_CXX14 constexpr
#else
#    define RAPIDFUZZ_CONSTEXPR_CXX14 inline
#endif