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) 34 #ifdef __has_cpp_attribute 35 # if __has_cpp_attribute(deprecated) && __cplusplus >= 201402L 36 # define SPOT_DEPRECATED(msg) [[deprecated(msg)]] 37 # elif __has_cpp_attribute(gnu::deprecated) 38 # define SPOT_DEPRECATED(msg) [[gnu::deprecated(msg)]] 39 # elif __has_cpp_attribute(clang::deprecated) 40 # define SPOT_DEPRECATED(msg) [[clang::deprecated(msg)]] 43 #ifndef SPOT_DEPRECATED 45 # define SPOT_DEPRECATED(msg) __attribute__ ((deprecated)) 46 # elif defined(_MSC_VER) 47 # define SPOT_DEPRECATED(msg) __declspec(deprecated) 49 # define SPOT_DEPRECATED(msg) 53 #if defined _WIN32 || defined __CYGWIN__ 54 #define SPOT_HELPER_DLL_IMPORT __declspec(dllimport) 55 #define SPOT_HELPER_DLL_EXPORT __declspec(dllexport) 56 #define SPOT_HELPER_DLL_LOCAL 59 #define SPOT_HELPER_DLL_IMPORT __attribute__ ((visibility ("default"))) 60 #define SPOT_HELPER_DLL_EXPORT __attribute__ ((visibility ("default"))) 61 #define SPOT_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden"))) 63 #define SPOT_HELPER_DLL_IMPORT 64 #define SPOT_HELPER_DLL_EXPORT 65 #define SPOT_HELPER_DLL_LOCAL 78 #define spot_assert__ assert 79 #if defined(SPOT_BUILD) or defined(SPOT_DEBUG) 80 #define SPOT_ASSERT(x) spot_assert__(x) 82 #define SPOT_ASSERT(x) while (0) 90 #define SPOT_API SPOT_HELPER_DLL_EXPORT 92 #define SPOT_API SPOT_HELPER_DLL_IMPORT 94 #define SPOT_LOCAL SPOT_HELPER_DLL_LOCAL 99 #define SPOT_API_VAR extern SPOT_API 110 #if defined __clang__ || defined __GNUC__ 111 # define SPOT_UNREACHABLE_BUILTIN() __builtin_unreachable() 112 # elif defined _MSC_VER 113 # define SPOT_UNREACHABLE_BUILTIN() __assume(0) 115 # define SPOT_UNREACHABLE_BUILTIN() abort() 120 #define SPOT_UNREACHABLE() do { \ 121 SPOT_ASSERT(!("unreachable code reached")); \ 122 SPOT_UNREACHABLE_BUILTIN(); \ 125 #define SPOT_UNIMPLEMENTED() throw std::runtime_error("unimplemented"); 129 #define SPOT_ASSUME(cond) assert(cond) 131 #define SPOT_ASSUME(cond) \ 135 SPOT_UNREACHABLE_BUILTIN(); \ 143 #define SPOT_RETURN(code) -> decltype(code) { return code; } 150 #ifdef __has_cpp_attribute 151 # if __has_cpp_attribute(fallthrough) && __cplusplus > 201402L 152 # define SPOT_FALLTHROUGH [[fallthrough]] 153 # elif __has_cpp_attribute(clang::fallthrough) 154 # define SPOT_FALLTHROUGH [[clang::fallthrough]] 155 # elif __has_cpp_attribute(gnu::fallthrough) 156 # define SPOT_FALLTHROUGH [[gnu::fallthrough]] 159 #ifndef SPOT_FALLTHROUGH 163 # define SPOT_FALLTHROUGH [[clang::fallthrough]] 165 # define SPOT_FALLTHROUGH while (0) 174 : std::runtime_error(s)
195 #if __GNUC__ == 8 && __GNUC_MINOR__ == 2 196 # define SPOT_make_shared_enabled__(TYPE, ...) \ 197 std::shared_ptr<TYPE>(new TYPE(__VA_ARGS__)) 199 # define SPOT_make_shared_enabled__(TYPE, ...) \ 200 std::make_shared<TYPE>(__VA_ARGS__) Definition: automata.hh:26
Definition: common.hh:171