Prefix all global variables to aid debugging.
[darkstat] / darkstat.h
1 /* darkstat 3
2 * copyright (c) 2001-2008 Emil Mikulic.
3 *
4 * darkstat.h: general macros
5 */
6
7 /*
8 * We only care about the following from config.h:
9 * - PACKAGE_NAME
10 * - PACKAGE_VERSION
11 * - PACKAGE_STRING
12 */
13 #include "config.h"
14 #include "opt.h"
15
16 #ifdef __GNUC__
17 # define _unused_ __attribute__((__unused__))
18 # define _noreturn_ __attribute__((__noreturn__))
19 # define _printflike_(fmtarg, firstvararg) \
20 __attribute__((__format__ (__printf__, fmtarg, firstvararg) ))
21 #else
22 # define _unused_
23 # define _noreturn_
24 # define _printflike_(fmtarg, firstvararg)
25 #endif
26
27 #if __GNUC__ == 2
28 # define inline __inline__
29 #else
30 # ifdef __TenDRA__
31 # define inline __inline
32 # endif
33 #endif
34
35 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901
36 #define restrict __restrict
37 #endif
38
39 #ifndef max
40 # define max(a,b) ((a) > (b) ? (a) : (b))
41 #endif
42
43 #ifndef min
44 # define min(a,b) ((a) < (b) ? (a) : (b))
45 #endif
46
47 /* vim:set ts=3 sw=3 tw=78 expandtab: */