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_VISIBLE 40 # if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) 41 # define GIRARA_VISIBLE __attribute__((visibility("default"))) 43 # define GIRARA_VISIBLE 47 #ifndef GIRARA_DEPRECATED 48 # if defined(__GNUC__) 49 # define GIRARA_DEPRECATED(x) x __attribute__((deprecated)) 50 # define GIRARA_DEPRECATED_ __attribute__((deprecated)) 52 # define GIRARA_DEPRECATED(x) x 53 # define GIRARA_DEPRECATED_ 57 #ifndef GIRARA_ALLOC_SIZE 58 # if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \ 59 (defined(__clang__) && __has_attribute(__alloc_size__)) 60 # define GIRARA_ALLOC_SIZE(...) __attribute__((alloc_size(__VA_ARGS__))) 62 # define GIRARA_ALLOC_SIZE(x) 66 #ifndef GIRARA_DO_PRAGMA 67 # if defined(__GNUC__) || defined(__clang__) 68 # define GIRARA_DO_PRAGMA(x) _Pragma(#x) 70 # define GIRARA_DO_PRAGMA(x) 74 #ifndef GIRARA_IGNORE_DEPRECATED 75 # define GIRARA_IGNORE_DEPRECATED \ 76 GIRARA_DO_PRAGMA(GCC diagnostic push) \ 77 GIRARA_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations") 80 #ifndef GIRARA_UNIGNORE 81 # define GIRARA_UNIGNORE \ 82 GIRARA_DO_PRAGMA(GCC diagnostic pop)