Go to the documentation of this file. 24 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) 26 #if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) 36 #define XRT_PRINTF_FORMAT(fmt, list) __attribute__((format(printf, fmt, list))) 38 #define XRT_PRINTF_FORMAT(fmt, list) 46 #define XRT_MAYBE_UNUSED __attribute__((unused)) 48 #define XRT_MAYBE_UNUSED 56 #define XRT_NO_INLINE __attribute__((noinline)) 68 #define XRT_DEBUGBREAK() 69 #elif defined(__clang__) || defined(__GNUC__) 70 #define XRT_DEBUGBREAK() __builtin_trap() 71 #elif defined(_MSC_VER) 73 #define XRT_DEBUGBREAK() __debugbreak() 75 #error "compiler not supported" 81 #define xrt_atomic_inc_return(v) __sync_add_and_fetch((v), 1) 82 #define xrt_atomic_dec_return(v) __sync_sub_and_fetch((v), 1) 83 #define xrt_atomic_cmpxchg(v, old, _new) \ 84 __sync_val_compare_and_swap((v), (old), (_new)) 86 #error "compiler not supported" 94 #define container_of(ptr, type, field) \ 95 (type *)((char *)ptr - offsetof(type, field))