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)
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__)
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)
27 # define GIRARA_HIDDEN __attribute__((visibility("hidden")))
28 # else
29 # define GIRARA_HIDDEN
30 # endif
31 #endif
32 
33 #ifndef GIRARA_DEPRECATED
34 # if defined(__GNUC__)
35 # define GIRARA_DEPRECATED(x) x __attribute__((deprecated))
36 # else
37 # define GIRARA_DEPRECATED(x) x
38 # endif
39 #endif
40 
41 #endif