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
7#ifndef _TIME_SHIELD_CONFIG_HPP_INCLUDED
8#define _TIME_SHIELD_CONFIG_HPP_INCLUDED
9
10// Check and define macros based on the C++ standard version
11#if __cplusplus == 201103L
12# define TIME_SHIELD_CPP11
13#else
14#if __cplusplus == 201402L
15# define TIME_SHIELD_CPP14
16#else
17#if __cplusplus >= 201703L
18# define TIME_SHIELD_CPP17
19#endif
20#endif
21#endif
22
23// Configure support for `constexpr` and `if constexpr` based on the C++ standard
24#ifdef TIME_SHIELD_CPP11
25# define TIME_SHIELD_IF_CONSTEXPR
26# define TIME_SHIELD_CONSTEXPR
27#else
28#ifdef TIME_SHIELD_CPP14
29# define TIME_SHIELD_IF_CONSTEXPR
30# define TIME_SHIELD_CONSTEXPR constexpr
31#else
32#ifdef TIME_SHIELD_CPP17
33# define TIME_SHIELD_IF_CONSTEXPR constexpr
34# define TIME_SHIELD_CONSTEXPR constexpr
35#endif
36#endif
37#endif
38
39#endif // _TIME_SHIELD_CONFIG_HPP_INCLUDED