mimic++ v9.2.1
Loading...
Searching...
No Matches
Config.hpp
Go to the documentation of this file.
1// Copyright Dominic (DNKpp) Koepke 2024 - 2025.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at
4// https://www.boost.org/LICENSE_1_0.txt)
5
6#ifndef MIMICPP_CONFIG_CONFIG_HPP
7#define MIMICPP_CONFIG_CONFIG_HPP
8
9#pragma once
10
11#ifndef MIMICPP_DETAIL_IS_MODULE
12 #include <cstdint>
13 #include <version>
14#endif
15
16#ifdef MIMICPP_DETAIL_IS_MODULE
17 #define MIMICPP_DETAIL_MODULE_EXPORT export
18#else
19 #define MIMICPP_DETAIL_MODULE_EXPORT
20#endif
21
22#if INTPTR_MAX < INT64_MAX
23 #define MIMICPP_DETAIL_IS_32BIT 1
24#endif
25
26#ifdef _LIBCPP_VERSION
27 #define MIMICPP_DETAIL_USES_LIBCXX 1
28#endif
29
30#ifdef __GNUC__
31 #ifdef __clang__
32 #define MIMICPP_DETAIL_IS_CLANG 1
33 #else
34 #define MIMICPP_DETAIL_IS_GCC 1
35 #endif
36#endif
37
38#ifdef _WIN32
39 #define MIMICPP_DETAIL_IS_WINDOWS 1
40#endif
41
42#ifdef _MSC_VER
43 #ifdef __clang__
44 #define MIMICPP_DETAIL_IS_CLANG_CL 1
45 #else
46 #define MIMICPP_DETAIL_IS_MSVC 1
47 #endif
48#endif
49
50#ifndef MIMICPP_ASSERT
51 #define MIMICPP_ASSERT(condition, msg) (void(0))
52#endif
53
54// clang-format off
55// Prevent number from getting decorated with '.
56#if 201907L <= __cpp_lib_constexpr_string
57 // clang-format on
58 #define MIMICPP_DETAIL_CONSTEXPR_STRING constexpr
59#else
60 #define MIMICPP_DETAIL_CONSTEXPR_STRING inline
61#endif
62
63// clang-format off
64// Prevent number from getting decorated with '.
65#if 201907L <= __cpp_lib_constexpr_vector
66 // clang-format on
67 #define MIMICPP_DETAIL_CONSTEXPR_VECTOR constexpr
68#else
69 #define MIMICPP_DETAIL_CONSTEXPR_VECTOR inline
70#endif
71
72// gcc 10 requires a workaround, due to some ambiguities.
73// see: https://github.com/DNKpp/mimicpp/issues/151
74#if MIMICPP_DETAIL_IS_GCC \
75 && __GNUC__ <= 10
76 #define MIMICPP_DETAIL_STD_GET_WORKAROUND 1
77#endif
78
79#endif