Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef _TIME_SHIELD_CONFIG_HPP_INCLUDED
3#define _TIME_SHIELD_CONFIG_HPP_INCLUDED
4
10
11// Check and define macros based on the C++ standard version
12#if __cplusplus == 201103L
13# define TIME_SHIELD_CPP11
14#else
15#if __cplusplus == 201402L
16# define TIME_SHIELD_CPP14
17#else
18#if __cplusplus >= 201703L
19# define TIME_SHIELD_CPP17
20#endif
21#endif
22#endif
23
24// Configure support for `constexpr` and `if constexpr` based on the C++ standard
25#ifdef TIME_SHIELD_CPP11
26# define TIME_SHIELD_IF_CONSTEXPR
27# define TIME_SHIELD_CONSTEXPR
28#else
29#ifdef TIME_SHIELD_CPP14
30# define TIME_SHIELD_IF_CONSTEXPR
31# define TIME_SHIELD_CONSTEXPR constexpr
32#else
33#ifdef TIME_SHIELD_CPP17
34# define TIME_SHIELD_IF_CONSTEXPR constexpr
35# define TIME_SHIELD_CONSTEXPR constexpr
36#endif
37#endif
38#endif
39
40#endif // _TIME_SHIELD_CONFIG_HPP_INCLUDED