simdjson
4.2.2
Ridiculously Fast JSON
Loading...
Searching...
No Matches
compiler_check.h
1
#ifndef SIMDJSON_COMPILER_CHECK_H
2
#define SIMDJSON_COMPILER_CHECK_H
3
4
#ifndef __cplusplus
5
#error simdjson requires a C++ compiler
6
#endif
7
8
#ifndef SIMDJSON_CPLUSPLUS
9
#if defined(_MSVC_LANG) && !defined(__clang__)
10
#define SIMDJSON_CPLUSPLUS (_MSC_VER == 1900 ? 201103L : _MSVC_LANG)
11
#else
12
#define SIMDJSON_CPLUSPLUS __cplusplus
13
#endif
14
#endif
15
16
// C++ 26
17
#if !defined(SIMDJSON_CPLUSPLUS26) && (SIMDJSON_CPLUSPLUS >= 202402L)
// update when the standard is finalized
18
#define SIMDJSON_CPLUSPLUS26 1
19
#endif
20
21
// C++ 23
22
#if !defined(SIMDJSON_CPLUSPLUS23) && (SIMDJSON_CPLUSPLUS >= 202302L)
23
#define SIMDJSON_CPLUSPLUS23 1
24
#endif
25
26
// C++ 20
27
#if !defined(SIMDJSON_CPLUSPLUS20) && (SIMDJSON_CPLUSPLUS >= 202002L)
28
#define SIMDJSON_CPLUSPLUS20 1
29
#endif
30
31
// C++ 17
32
#if !defined(SIMDJSON_CPLUSPLUS17) && (SIMDJSON_CPLUSPLUS >= 201703L)
33
#define SIMDJSON_CPLUSPLUS17 1
34
#endif
35
36
// C++ 14
37
#if !defined(SIMDJSON_CPLUSPLUS14) && (SIMDJSON_CPLUSPLUS >= 201402L)
38
#define SIMDJSON_CPLUSPLUS14 1
39
#endif
40
41
// C++ 11
42
#if !defined(SIMDJSON_CPLUSPLUS11) && (SIMDJSON_CPLUSPLUS >= 201103L)
43
#define SIMDJSON_CPLUSPLUS11 1
44
#endif
45
46
#ifndef SIMDJSON_CPLUSPLUS11
47
#error simdjson requires a compiler compliant with the C++11 standard
48
#endif
49
50
#ifndef SIMDJSON_IF_CONSTEXPR
51
#if SIMDJSON_CPLUSPLUS17
52
#define SIMDJSON_IF_CONSTEXPR if constexpr
53
#else
54
#define SIMDJSON_IF_CONSTEXPR if
55
#endif
56
#endif
57
58
#ifndef SIMDJSON_CONSTEXPR_LAMBDA
59
#if SIMDJSON_CPLUSPLUS17
60
#define SIMDJSON_CONSTEXPR_LAMBDA constexpr
61
#else
62
#define SIMDJSON_CONSTEXPR_LAMBDA
63
#endif
64
#endif
65
66
67
68
#ifdef __has_include
69
#if __has_include(<version>)
70
#include <version>
71
#endif
72
#endif
73
74
// The current specification is unclear on how we detect
75
// static reflection, both __cpp_lib_reflection and
76
// __cpp_impl_reflection are proposed in the draft specification.
77
// For now, we disable static reflect by default. It must be
78
// specified at compiler time.
79
#ifndef SIMDJSON_STATIC_REFLECTION
80
#define SIMDJSON_STATIC_REFLECTION 0
// disabled by default.
81
#endif
82
83
#if defined(__apple_build_version__)
84
#if __apple_build_version__ < 14000000
85
#define SIMDJSON_CONCEPT_DISABLED 1
// apple-clang/13 doesn't support std::convertible_to
86
#endif
87
#endif
88
89
#if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 201911L
90
#include <ranges>
91
#define SIMDJSON_SUPPORTS_RANGES 1
92
#else
93
#define SIMDJSON_SUPPORTS_RANGES 0
94
#endif
95
96
#if defined(__cpp_concepts) && !defined(SIMDJSON_CONCEPT_DISABLED)
97
#if __cpp_concepts >= 201907L
98
#include <utility>
99
#define SIMDJSON_SUPPORTS_CONCEPTS 1
100
#else
101
#define SIMDJSON_SUPPORTS_CONCEPTS 0
102
#endif
103
#else
// defined(__cpp_concepts) && !defined(SIMDJSON_CONCEPT_DISABLED)
104
#define SIMDJSON_SUPPORTS_CONCEPTS 0
105
#endif
// defined(__cpp_concepts) && !defined(SIMDJSON_CONCEPT_DISABLED)
106
107
// copy SIMDJSON_SUPPORTS_CONCEPTS to SIMDJSON_SUPPORTS_DESERIALIZATION.
108
#if SIMDJSON_SUPPORTS_CONCEPTS
109
#define SIMDJSON_SUPPORTS_DESERIALIZATION 1
110
#else
111
#define SIMDJSON_SUPPORTS_DESERIALIZATION 0
112
#endif
113
114
115
#if !defined(SIMDJSON_CONSTEVAL)
116
#if defined(__cpp_consteval) && __cpp_consteval >= 201811L && defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L
117
#define SIMDJSON_CONSTEVAL 1
118
#else
119
#define SIMDJSON_CONSTEVAL 0
120
#endif
// defined(__cpp_consteval) && __cpp_consteval >= 201811L && defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L
121
#endif
// !defined(SIMDJSON_CONSTEVAL)
122
123
#endif
// SIMDJSON_COMPILER_CHECK_H
include
simdjson
compiler_check.h
Generated by
1.9.8