-
Notifications
You must be signed in to change notification settings - Fork 6
/
constexpr.hpp
94 lines (77 loc) · 1.79 KB
/
constexpr.hpp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
* @file constexpr.hpp
* @brief
* @date 2019-5-11
* @author Peter
* @copyright
* Peter of [ThinkSpirit Laboratory](http://thinkspirit.org/)
* of [Nanjing University of Information Science & Technology](http://www.nuist.edu.cn/)
* all rights reserved
*/
#ifndef KERBAL_COMPATIBILITY_CONSTEXPR_HPP
#define KERBAL_COMPATIBILITY_CONSTEXPR_HPP
#ifndef KERBAL_ENABLE_CONSTEXPR
# if __cplusplus >= 201103L
# define KERBAL_ENABLE_CONSTEXPR 1
# else
# define KERBAL_ENABLE_CONSTEXPR 0
# endif
#endif
#ifndef KERBAL_CONSTEXPR
# if KERBAL_ENABLE_CONSTEXPR
# define KERBAL_CONSTEXPR constexpr
# else
# define KERBAL_CONSTEXPR
# endif
#endif
#ifndef KERBAL_ENABLE_CONSTEXPR14
# if __cplusplus >= 201402L
# define KERBAL_ENABLE_CONSTEXPR14 1
# else
# define KERBAL_ENABLE_CONSTEXPR14 0
# endif
#endif
#ifndef KERBAL_CONSTEXPR14
# if KERBAL_ENABLE_CONSTEXPR14
# define KERBAL_CONSTEXPR14 constexpr
# else
# define KERBAL_CONSTEXPR14
# endif
#endif
#ifndef KERBAL_ENABLE_CONSTEXPR17
# if __cplusplus >= 201703L
# if __cpp_constexpr >= 201402L
# define KERBAL_ENABLE_CONSTEXPR17 1
# else
# define KERBAL_ENABLE_CONSTEXPR17 0
# endif
# else
# define KERBAL_ENABLE_CONSTEXPR17 0
# endif
#endif
#ifndef KERBAL_CONSTEXPR17
# if KERBAL_ENABLE_CONSTEXPR17
# define KERBAL_CONSTEXPR17 constexpr
# else
# define KERBAL_CONSTEXPR17
# endif
#endif
#ifndef KERBAL_ENABLE_CONSTEXPR20
# if __cplusplus > 201703L
# if __cpp_constexpr >= 201907L
# define KERBAL_ENABLE_CONSTEXPR20 1
# else
# define KERBAL_ENABLE_CONSTEXPR20 0
# endif
# else
# define KERBAL_ENABLE_CONSTEXPR20 0
# endif
#endif
#ifndef KERBAL_CONSTEXPR20
# if KERBAL_ENABLE_CONSTEXPR20
# define KERBAL_CONSTEXPR20 constexpr
# else
# define KERBAL_CONSTEXPR20
# endif
#endif
#endif // KERBAL_COMPATIBILITY_CONSTEXPR_HPP