girara
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
macros.h
Go to the documentation of this file.
1 /* See LICENSE file for license and copyright information */
2 
3 #ifndef GIRARA_MACROS_H
4 #define GIRARA_MACROS_H
5 
6 #ifndef GIRARA_PRINTF
7 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) || defined(__clang__)
8 # define GIRARA_PRINTF(format_idx, arg_idx) \
9  __attribute__((__format__ (__printf__, format_idx, arg_idx)))
10 # else
11 # define GIRARA_PRINTF(format_idx, arg_idx)
12 # endif
13 #endif
14 
15 #ifndef GIRARA_UNUSED
16 # if defined(__GNUC__) || defined(__clang__)
17 # define GIRARA_UNUSED(x) UNUSED_ ## x __attribute__((unused))
18 # elif defined(__LCLINT__)
19 # define GIRARA_UNUSED(x) /*@unused@*/ x
20 # else
21 # define GIRARA_UNUSED(x) x
22 # endif
23 #endif
24 
25 #ifndef GIRARA_HIDDEN
26 # if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
27 # define GIRARA_HIDDEN __attribute__((visibility("hidden")))
28 # elif defined(__SUNPRO_C)
29 # define GIRARA_HIDDEN __hidden
30 # else
31 # define GIRARA_HIDDEN
32 # endif
33 #endif
34 
35 #ifndef GIRARA_DEPRECATED
36 # if defined(__GNUC__)
37 # define GIRARA_DEPRECATED(x) x __attribute__((deprecated))
38 # else
39 # define GIRARA_DEPRECATED(x) x
40 # endif
41 #endif
42 
43 #endif