1 #ifndef MPV_COMPILER_H 2 #define MPV_COMPILER_H 3 4 #define MP_EXPAND_ARGS(...) __VA_ARGS__ 5 6 #ifdef __GNUC__ 7 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2))) 8 #define MP_NORETURN __attribute__((noreturn)) 9 #else 10 #define PRINTF_ATTRIBUTE(a1, a2) 11 #define MP_NORETURN 12 #endif 13 14 // Broken crap with __USE_MINGW_ANSI_STDIO 15 #if defined(__MINGW32__) && defined(__GNUC__) && !defined(__clang__) 16 #undef PRINTF_ATTRIBUTE 17 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (gnu_printf, a1, a2))) 18 #endif 19 20 #if __STDC_VERSION__ >= 201112L 21 #include <stdalign.h> 22 #else 23 #define alignof(x) (offsetof(struct {char unalign_; x u;}, u)) 24 #endif 25 26 #endif 27