Go to the documentation of this file. 3 #ifndef GIRARA_MACROS_H 4 #define GIRARA_MACROS_H 6 #ifndef __has_attribute 7 #define __has_attribute(x) 0 11 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) || defined(__clang__) 12 # define GIRARA_PRINTF(format_idx, arg_idx) \ 13 __attribute__((__format__ (__printf__, format_idx, arg_idx))) 15 # define GIRARA_PRINTF(format_idx, arg_idx) 20 # if defined(__GNUC__) || defined(__clang__) 21 # define GIRARA_UNUSED(x) UNUSED_ ## x __attribute__((unused)) 22 # elif defined(__LCLINT__) 23 # define GIRARA_UNUSED(x) x 25 # define GIRARA_UNUSED(x) x 30 # if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) 31 # define GIRARA_HIDDEN __attribute__((visibility("hidden"))) 32 # elif defined(__SUNPRO_C) 33 # define GIRARA_HIDDEN __hidden 35 # define GIRARA_HIDDEN 39 #ifndef GIRARA_DEPRECATED 40 # if defined(__GNUC__) 41 # define GIRARA_DEPRECATED(x) x __attribute__((deprecated)) 42 # define GIRARA_DEPRECATED_ __attribute__((deprecated)) 44 # define GIRARA_DEPRECATED(x) x 45 # define GIRARA_DEPRECATED_ 49 #ifndef GIRARA_ALLOC_SIZE 50 # if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \ 51 (defined(__clang__) && __has_attribute(__alloc_size__)) 52 # define GIRARA_ALLOC_SIZE(...) __attribute__((alloc_size(__VA_ARGS__))) 54 # define GIRARA_ALLOC_SIZE(x) 58 #ifndef GIRARA_DO_PRAGMA 59 # if defined(__GNUC__) || defined(__clang__) 60 # define GIRARA_DO_PRAGMA(x) _Pragma(#x) 62 # define GIRARA_DO_PRAGMA(x) 66 #ifndef GIRARA_IGNORE_DEPRECATED 67 # define GIRARA_IGNORE_DEPRECATED \ 68 GIRARA_DO_PRAGMA(GCC diagnostic push) \ 69 GIRARA_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations") 72 #ifndef GIRARA_UNIGNORE 73 # define GIRARA_UNIGNORE \ 74 GIRARA_DO_PRAGMA(GCC diagnostic pop)