27 #define SPOT_LIKELY(expr) __builtin_expect(!!(expr), 1)
28 #define SPOT_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
30 #define SPOT_LIKELY(expr) (expr)
31 #define SPOT_UNLIKELY(expr) (expr)
35 #define SPOT_DEPRECATED(msg)
36 #define SPOT_FALLTHROUGH
38 #if __cplusplus < 201703L
39 #error C++17 compiler required
41 #define SPOT_DEPRECATED(msg) [[deprecated(msg)]]
42 #define SPOT_FALLTHROUGH [[fallthrough]]
45 #if defined _WIN32 || defined __CYGWIN__
46 #define SPOT_HELPER_DLL_IMPORT __declspec(dllimport)
47 #define SPOT_HELPER_DLL_EXPORT __declspec(dllexport)
48 #define SPOT_HELPER_DLL_LOCAL
51 #define SPOT_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
52 #define SPOT_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
53 #define SPOT_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
55 #define SPOT_HELPER_DLL_IMPORT
56 #define SPOT_HELPER_DLL_EXPORT
57 #define SPOT_HELPER_DLL_LOCAL
70 #define spot_assert__ assert
71 #if defined(SPOT_BUILD) or defined(SPOT_DEBUG)
72 #define SPOT_ASSERT(x) spot_assert__(x)
76 #define SPOT_ASSERT(x) while (0)
84 #define SPOT_API SPOT_HELPER_DLL_EXPORT
86 #define SPOT_API SPOT_HELPER_DLL_IMPORT
88 #define SPOT_LOCAL SPOT_HELPER_DLL_LOCAL
93 #define SPOT_API_VAR extern SPOT_API
104 #if defined __clang__ || defined __GNUC__
105 # define SPOT_UNREACHABLE_BUILTIN() __builtin_unreachable()
106 # elif defined _MSC_VER
107 # define SPOT_UNREACHABLE_BUILTIN() __assume(0)
109 # define SPOT_UNREACHABLE_BUILTIN() abort()
114 #define SPOT_UNREACHABLE() do { \
115 SPOT_ASSERT(!("unreachable code reached")); \
116 SPOT_UNREACHABLE_BUILTIN(); \
119 #define SPOT_UNIMPLEMENTED() throw std::runtime_error("unimplemented");
122 #if SPOT_DEBUG && !defined(NDEBUG)
123 #define SPOT_ASSUME(cond) assert(cond)
125 #define SPOT_ASSUME(cond) \
129 SPOT_UNREACHABLE_BUILTIN(); \
137 #define SPOT_RETURN(code) -> decltype(code) { return code; }
144 : std::runtime_error(s)
163 unsigned nthreads()
const
186 #if __GNUC__ == 8 && __GNUC_MINOR__ == 2
187 # define SPOT_make_shared_enabled__(TYPE, ...) \
188 std::shared_ptr<TYPE>(new TYPE(__VA_ARGS__))
190 # define SPOT_make_shared_enabled__(TYPE, ...) \
191 std::make_shared<TYPE>(__VA_ARGS__)
This class is used to tell parallel algorithms what resources they may use.
Definition: common.hh:156
Definition: automata.hh:27
Definition: common.hh:142