8# if USING(LIBREPR_COMPILER_MSVC)
9# if defined(_DEBUG) && !defined(NDEBUG)
10# define LIBREPR_DEBUG 1
14# define LIBREPR_DEBUG 1
19#if USING(LIBREPR_PLATFORM_WINDOWS)
20# if USING(LIBREPR_COMPILER_MSVC)
22# include <vcruntime.h>
23# define LIBREPR_CRT_BEGIN_C _CRT_BEGIN_C_HEADER
24# define LIBREPR_CRT_END_C _CRT_END_C_HEADER
26# define LIBREPR_CRT_BEGIN_C \
27 _Pragma("pack(push, 8)") \
29# define LIBREPR_CRT_END_C } \
36#if USING(LIBREPR_PLATFORM_WINDOWS)
37# define LIBREPR_UND_ASSERT_(...) \
38 _assert((__VA_ARGS__), (__FILE__), unsigned(__LINE__))
45 __declspec(dllimport)
void
53#elif USING(LIBREPR_PLATFORM_MACOS)
54# define LIBREPR_UND_ASSERT_(...) \
55 __assert_rtn((__func__), (__FILE__), unsigned(__LINE__), (__VA_ARGS__))
57# define LIBREPR_UND_ASSERT_(...) \
58 __assert_fail((__VA_ARGS__), __FILE__, __LINE__, __PRETTY_FUNCTION__)
64# define LIBREPR_EXASSERT(...) \
65 LIBREPR_UND_ASSERT_((REPR_FORMAT(__VA_ARGS__)).c_str())
67# define LIBREPR_ASSERT(cond, ...) \
68 do { if(!(cond)) [[unlikely]] { LIBREPR_EXASSERT(__VA_ARGS__); } } while(0)
70# define LIBREPR_EXASSERT(...) ::librepr::detail::unreachable()
71# define LIBREPR_ASSERT(...) (void)(0)
74#if USING(REPR_HARD_CHECKS)
75# define LIBREPR_SOFT_ASSERT(...) LIBREPR_ASSERT(__VA_ARGS__)
78# define LIBREPR_SOFT_ASSERT(...) (void)(0)
81#ifdef __cpp_lib_unreachable
82# define LIBREPR_UNREACHABLE() std::unreachable()
83#elif USING(LIBREPR_COMPILER_MSVC)
84# define LIBREPR_UNREACHABLE() __assume(false)
86# define LIBREPR_UNREACHABLE() __builtin_unreachable()
90#ifndef __cpp_lib_unreachable
95 using std::unreachable;
#define LIBREPR_UNREACHABLE()
Definition assert.h:86
void unreachable()
Definition assert.h:91
std::string code_for()
Definition repr:39