Go to the documentation of this file.
27 #ifndef ZYDIS_DEFINES_H
28 #define ZYDIS_DEFINES_H
31 #include <ZydisExportConfig.h>
37 #if defined(__clang__)
40 #elif defined(__ICC) || defined(__INTEL_COMPILER)
42 #elif defined(__GNUC__) || defined(__GNUG__)
45 #elif defined(_MSC_VER)
47 #elif defined(__BORLANDC__)
48 # define ZYDIS_BORLAND
50 # define ZYDIS_UNKNOWN_COMPILER
58 # define ZYDIS_WINDOWS
59 #elif defined(__APPLE__)
62 #elif defined(__linux)
68 #elif defined(__posix)
71 # error "Unsupported platform detected"
78 #if defined (_M_AMD64) || defined (__x86_64__)
80 #elif defined (_M_IX86) || defined (__i386__)
83 # error "Unsupported architecture detected"
90 #if defined(ZYDIS_MSVC) || defined(ZYDIS_BORLAND)
94 # define ZYDIS_RELEASE
96 #elif defined(ZYDIS_GNUC) || defined(ZYDIS_ICC)
98 # define ZYDIS_RELEASE
103 # error "Unsupported compiler detected"
110 #if defined(ZYDIS_MSVC) || defined(ZYDIS_BORLAND)
111 # define ZYDIS_INLINE __inline
113 # define ZYDIS_INLINE static inline
120 #define ZYDIS_ASSERT(condition) assert(condition)
122 #if defined(ZYDIS_RELEASE)
123 # if defined(ZYDIS_GNUC)
124 # if __has_builtin(__builtin_unreachable)
125 # define ZYDIS_UNREACHABLE __builtin_unreachable()
127 # define ZYDIS_UNREACHABLE
130 # define ZYDIS_UNREACHABLE
133 # define ZYDIS_UNREACHABLE assert(0)
143 #define ZYDIS_BITFIELD(x) : x
148 #define ZYDIS_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))