-
Notifications
You must be signed in to change notification settings - Fork 12
/
config.hpp.in
116 lines (75 loc) · 3.09 KB
/
config.hpp.in
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copyright 2020, 2021, 2022, 2023, 2024 Francesco Biscani ([email protected]), Dario Izzo ([email protected])
//
// This file is part of the heyoka library.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef HEYOKA_CONFIG_HPP
#define HEYOKA_CONFIG_HPP
// clang-format off
#define HEYOKA_VERSION_STRING "@heyoka_VERSION@"
#define HEYOKA_VERSION_MAJOR @heyoka_VERSION_MAJOR@
#define HEYOKA_VERSION_MINOR @heyoka_VERSION_MINOR@
#define HEYOKA_VERSION_PATCH @heyoka_VERSION_PATCH@
#define HEYOKA_ABI_VERSION @HEYOKA_ABI_VERSION@
// clang-format on
#cmakedefine HEYOKA_WITH_MPPP
#cmakedefine HEYOKA_WITH_SLEEF
#cmakedefine HEYOKA_BUILD_STATIC_LIBRARY
#if defined(HEYOKA_WITH_MPPP)
#include <mp++/config.hpp>
#if !defined(MPPP_WITH_BOOST_S11N)
#error mp++ must be configured with support for Boost.serialization.
#endif
#if !defined(MPPP_WITH_FMT)
#error mp++ must be configured with support for the fmt library.
#endif
#if defined(MPPP_WITH_QUADMATH)
#define HEYOKA_HAVE_REAL128
#endif
#if defined(MPPP_WITH_MPFR)
#define HEYOKA_HAVE_REAL
#endif
#endif
// NOTE: handy Boost library for this since 1.73:
// https://www.boost.org/doc/libs/1_73_0/libs/predef/doc/index.html
//
// NOTE: it makes sense here to handle only the GCC/MSVC macros here
// (on the assumption that clang is identical to GCC in this respect).
// No point in using macros provided by compilers we do not test on.
#if defined(_ARCH_PPC) || defined(_M_PPC)
#define HEYOKA_ARCH_PPC
#endif
#if defined(__arm__) || defined(_M_ARM) || defined(_M_ARMT) || defined(__aarch64__) || defined(_M_ARM64)
#define HEYOKA_ARCH_ARM
#endif
#if defined(__x86_64__) || defined(_M_AMD64) || defined(__i386__) || defined(_M_IX86)
#define HEYOKA_ARCH_X86
#endif
// Setup of the ABI versioning and tagging
// machinery.
#if defined(__GNUC__) || defined(__clang__)
#define HEYOKA_ABI_TAG_ATTR __attribute__((abi_tag))
#else
#define HEYOKA_ABI_TAG_ATTR
#endif
// clang-format off
#define HEYOKA_BEGIN_NAMESPACE \
namespace heyoka \
{ \
inline namespace v@HEYOKA_ABI_VERSION@ HEYOKA_ABI_TAG_ATTR \
{
#define HEYOKA_END_NAMESPACE \
} \
}
// clang-format on
// C++20 constinit.
// NOTE: this seems to be buggy currently on MSVC:
// https://github.com/bluescarni/mppp/issues/291
#if defined(__cpp_constinit) && (!defined(_MSC_VER) || defined(__clang__))
#define HEYOKA_CONSTINIT constinit
#else
#define HEYOKA_CONSTINIT
#endif
#endif