Loading...
Searching...
No Matches
Go to the documentation of this file.
12#if (defined(__clang__) || defined(__GNUC__))
13 #define FIBER_ASSUME(cond) __builtin_assume(cond)
14#elif defined(_MSC_VER)
15 #define FIBER_ASSUME(cond) __assume(cond)
17 #define FIBER_ASSUME(cond)
21#if defined(__clang__) || defined(__GNUC__)
22 #define FIBER_FUNCTION_SIGNATURE __PRETTY_FUNCTION__
23#elif defined(_MSC_VER)
24 #define FIBER_FUNCTION_SIGNATURE __FUNCSIG__
26 #define FIBER_FUNCTION_SIGNATURE __func__
30#if __cplusplus >= 202002L
32 #define FIBER_IF_LIKELY(condition) if(condition) [[likely]]
33 #define FIBER_IF_UNLIKELY(condition) if(condition) [[unlikely]]
34#elif defined(__clang__) || defined(__GNUC__)
36 #define FIBER_IF_LIKELY(condition) if(__builtin_expect(condition, 1))
37 #define FIBER_IF_UNLIKELY(condition) if(__builtin_expect(condition, 0))
40 #define FIBER_LIKELY if(condition)
41 #define FIBER_UNLIKELY if(condition)
44#define FIBER_USE_UNUSED(value) ((void)sizeof(value))
46#if defined(__GNUC__) || defined(__clang__)
48 #define FIBER_WEAK __attribute__((weak))
49#elif defined(__CC_ARM)
51 #define FIBER_WEAK __weak
52#elif defined(_MSC_VER)
54 #define FIBER_WEAK __declspec(selectany)
57 #warning "FIBER_WEAK not defined for this compiler. Please file an issue at the repository, state the compiler you use and how one defines weak symbols for it."