5 #ifndef UAVCAN_BUILD_CONFIG_HPP_INCLUDED
6 #define UAVCAN_BUILD_CONFIG_HPP_INCLUDED
11 #define UAVCAN_VERSION_MAJOR 1
12 #define UAVCAN_VERSION_MINOR 0
28 #define UAVCAN_CPP17 2017
29 #define UAVCAN_CPP14 2014
30 #define UAVCAN_CPP11 2011
31 #define UAVCAN_CPP03 2003
33 #ifndef UAVCAN_CPP_VERSION
34 # if __cplusplus > 201200
35 # error Unsupported C++ standard. You can explicitly set UAVCAN_CPP_VERSION=UAVCAN_CPP11 to silence this error.
36 # elif (__cplusplus > 201100) || defined(__GXX_EXPERIMENTAL_CXX0X__)
37 # define UAVCAN_CPP_VERSION UAVCAN_CPP11
39 # define UAVCAN_CPP_VERSION UAVCAN_CPP03
47 #ifndef UAVCAN_NULLPTR
48 # if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
49 # define UAVCAN_NULLPTR nullptr
51 # define UAVCAN_NULLPTR NULL
60 #ifndef UAVCAN_GENERAL_PURPOSE_PLATFORM
61 # if (defined(__linux__) || defined(__linux) || defined(__APPLE__) ||\
62 defined(_WIN64) || defined(_WIN32) || defined(__ANDROID__) ||\
63 defined(_SYSTYPE_BSD) || defined(__FreeBSD__))
64 # define UAVCAN_GENERAL_PURPOSE_PLATFORM 1
66 # define UAVCAN_GENERAL_PURPOSE_PLATFORM 0
75 # define UAVCAN_DEBUG 0
83 #ifndef UAVCAN_EXCEPTIONS
84 # define UAVCAN_EXCEPTIONS UAVCAN_GENERAL_PURPOSE_PLATFORM
91 #ifndef UAVCAN_NOEXCEPT
92 # if UAVCAN_EXCEPTIONS
93 # if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
94 # define UAVCAN_NOEXCEPT noexcept
96 # define UAVCAN_NOEXCEPT throw()
99 # define UAVCAN_NOEXCEPT
107 #ifndef UAVCAN_EXPORT
108 # define UAVCAN_EXPORT
118 # define UAVCAN_TINY 0
124 #ifndef UAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY
125 # define UAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY 0
132 #ifndef UAVCAN_TOSTRING
133 # if UAVCAN_EXCEPTIONS
134 # define UAVCAN_TOSTRING UAVCAN_GENERAL_PURPOSE_PLATFORM
136 # define UAVCAN_TOSTRING 0
141 # if !UAVCAN_EXCEPTIONS
142 # error UAVCAN_TOSTRING requires UAVCAN_EXCEPTIONS
152 #ifndef UAVCAN_IMPLEMENT_PLACEMENT_NEW
153 # define UAVCAN_IMPLEMENT_PLACEMENT_NEW 0
160 #ifndef UAVCAN_USE_EXTERNAL_SNPRINTF
161 # define UAVCAN_USE_EXTERNAL_SNPRINTF 0
168 #ifndef UAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION
169 # define UAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION 0
177 #ifndef UAVCAN_ASSERT
178 # ifndef UAVCAN_NO_ASSERTIONS
179 # define UAVCAN_NO_ASSERTIONS 0
181 # if UAVCAN_NO_ASSERTIONS
182 # define UAVCAN_ASSERT(x)
184 # define UAVCAN_ASSERT(x) assert(x)
188 #ifndef UAVCAN_LIKELY
190 # define UAVCAN_LIKELY(x) __builtin_expect(!!(x), true)
192 # define UAVCAN_LIKELY(x) (x)
196 #ifndef UAVCAN_UNLIKELY
198 # define UAVCAN_UNLIKELY(x) __builtin_expect(!!(x), false)
200 # define UAVCAN_UNLIKELY(x) (x)
220 #ifdef UAVCAN_MEM_POOL_BLOCK_SIZE
223 #elif defined(__BIGGEST_ALIGNMENT__) && (__BIGGEST_ALIGNMENT__ <= 8)
231 #ifdef __BIGGEST_ALIGNMENT__
243 template <
typename T>
259 #ifdef UAVCAN_FLOAT_COMPARISON_EPSILON_MULT
268 #ifdef UAVCAN_MAX_CAN_ACCEPTANCE_FILTERS
278 #endif // UAVCAN_BUILD_CONFIG_HPP_INCLUDED