26#define SPOT_LIKELY(expr) __builtin_expect(!!(expr), 1)
27#define SPOT_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
29#define SPOT_LIKELY(expr) (expr)
30#define SPOT_UNLIKELY(expr) (expr)
34 #define SPOT_DEPRECATED(msg)
35 #define SPOT_FALLTHROUGH
37 #if __cplusplus < 201703L
38 #error C++17 compiler required
40 #define SPOT_DEPRECATED(msg) [[deprecated(msg)]]
41 #define SPOT_FALLTHROUGH [[fallthrough]]
44#if defined _WIN32 || defined __CYGWIN__
45 #define SPOT_HELPER_DLL_IMPORT __declspec(dllimport)
46 #define SPOT_HELPER_DLL_EXPORT __declspec(dllexport)
47 #define SPOT_HELPER_DLL_LOCAL
50 #define SPOT_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
51 #define SPOT_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
52 #define SPOT_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
54 #define SPOT_HELPER_DLL_IMPORT
55 #define SPOT_HELPER_DLL_EXPORT
56 #define SPOT_HELPER_DLL_LOCAL
69#define spot_assert__ assert
70#if defined(SPOT_BUILD) || defined(SPOT_DEBUG)
71 #define SPOT_ASSERT(x) spot_assert__(x)
75 #define SPOT_ASSERT(x) while (0)
83 #define SPOT_API SPOT_HELPER_DLL_EXPORT
85 #define SPOT_API SPOT_HELPER_DLL_IMPORT
87 #define SPOT_LOCAL SPOT_HELPER_DLL_LOCAL
92#define SPOT_API_VAR extern SPOT_API
103#if defined __clang__ || defined __GNUC__
104# define SPOT_UNREACHABLE_BUILTIN() __builtin_unreachable()
105# elif defined _MSC_VER
106# define SPOT_UNREACHABLE_BUILTIN() __assume(0)
108# define SPOT_UNREACHABLE_BUILTIN() abort()
113#define SPOT_UNREACHABLE() do { \
114 SPOT_ASSERT(!("unreachable code reached")); \
115 SPOT_UNREACHABLE_BUILTIN(); \
118#define SPOT_UNIMPLEMENTED() throw std::runtime_error("unimplemented");
121#if SPOT_DEBUG && !defined(NDEBUG)
122#define SPOT_ASSUME(cond) assert(cond)
124#define SPOT_ASSUME(cond) \
128 SPOT_UNREACHABLE_BUILTIN(); \
136#define SPOT_RETURN(code) -> decltype(code) { return code; }
143 : std::runtime_error(s)
162 unsigned nthreads()
const
185#if __GNUC__ == 8 && __GNUC_MINOR__ == 2
186# define SPOT_make_shared_enabled__(TYPE, ...) \
187 std::shared_ptr<TYPE>(new TYPE(__VA_ARGS__))
189# define SPOT_make_shared_enabled__(TYPE, ...) \
190 std::make_shared<TYPE>(__VA_ARGS__)
This class is used to tell parallel algorithms what resources they may use.
Definition: common.hh:155
Definition: automata.hh:26
Definition: common.hh:141