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 #define __has_builtin(x) 0 15 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) || defined(__clang__) 16 # define GIRARA_PRINTF(format_idx, arg_idx) \ 17 __attribute__((__format__ (__printf__, format_idx, arg_idx))) 19 # define GIRARA_PRINTF(format_idx, arg_idx) 24 # if defined(__GNUC__) || defined(__clang__) 25 # define GIRARA_UNUSED(x) UNUSED_ ## x __attribute__((unused)) 26 # elif defined(__LCLINT__) 27 # define GIRARA_UNUSED(x) x 29 # define GIRARA_UNUSED(x) x 34 # if (defined(__GNUC__) && (__GNUC__ >= 4)) || __has_attribute(visibility) 35 # define GIRARA_HIDDEN __attribute__((visibility("hidden"))) 36 # elif defined(__SUNPRO_C) 37 # define GIRARA_HIDDEN __hidden 39 # define GIRARA_HIDDEN 43 #ifndef GIRARA_VISIBLE 44 # if (defined(__GNUC__) && (__GNUC__ >= 4)) || __has_attribute(visibility) 45 # define GIRARA_VISIBLE __attribute__((visibility("default"))) 47 # define GIRARA_VISIBLE 51 #ifndef GIRARA_DEPRECATED 52 # if defined(__GNUC__) 53 # define GIRARA_DEPRECATED(x) x __attribute__((deprecated)) 54 # define GIRARA_DEPRECATED_ __attribute__((deprecated)) 56 # define GIRARA_DEPRECATED(x) x 57 # define GIRARA_DEPRECATED_ 61 #ifndef GIRARA_ALLOC_SIZE 62 # if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \ 63 (defined(__clang__) && __has_attribute(__alloc_size__)) 64 # define GIRARA_ALLOC_SIZE(...) __attribute__((alloc_size(__VA_ARGS__))) 66 # define GIRARA_ALLOC_SIZE(x) 70 #ifndef GIRARA_DO_PRAGMA 71 # if defined(__GNUC__) || defined(__clang__) 72 # define GIRARA_DO_PRAGMA(x) _Pragma(#x) 74 # define GIRARA_DO_PRAGMA(x) 78 #ifndef GIRARA_IGNORE_DEPRECATED 79 # define GIRARA_IGNORE_DEPRECATED \ 80 GIRARA_DO_PRAGMA(GCC diagnostic push) \ 81 GIRARA_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations") 84 #ifndef GIRARA_UNIGNORE 85 # define GIRARA_UNIGNORE \ 86 GIRARA_DO_PRAGMA(GCC diagnostic pop)