Loading...
Searching...
No Matches
Go to the documentation of this file. 1#ifndef X86_ANNOTATIONS_H
2#define X86_ANNOTATIONS_H
14#define NORETURN __attribute__((noreturn))
18#if defined(__clang__) || defined(__GNUC__)
19#define FORCEINLINE static inline __attribute__((always_inline))
20#elif defined(_MSC_VER)
21#define FORCEINLINE static __forceinline
23#define FORCEINLINE static inline
28#ifndef FORCEINLINE_NOHEADER
29#if defined(__clang__) || defined(__GNUC__)
30#define FORCEINLINE_NOHEADER __attribute__((always_inline))
31#elif defined(_MSC_VER)
32#define FORCEINLINE_NOHEADER __forceinline
34#define FORCEINLINE_NOHEADER inline
39#define USED __attribute__((used))
42#define MUST_USE_RESULT __attribute__((warn_unused_result))
45#define COLD __attribute__((cold))
48#define HOT __attribute__((hot))
51#define PACKED __attribute__((packed))
54#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
57#define COMPILE_WARNING(msg) __attribute__((warning(msg)))
60#define COMPILE_ERROR(msg) __attribute__((error(msg)))
63#define SYSV_ABI __attribute__((sysv_abi))
66#define MS_ABI __attribute__((ms_abi))
69#define NOINLINE __attribute__((noinline))
72#define UNREACHABLE_CODE() __builtin_unreachable()
75#define VALIDATE_SIZE(struc, size) _Static_assert(sizeof(struc) == size, "Invalid structure size of " #struc)
78#define VALIDATE_OFFSET(struc, member, offset) _Static_assert(offsetof(struc, member) == offset, "The offset of " #member " in " #struc " is not " #offset "...")