0124cdccf1c4c2ffb8f921b506fc4b82f4ac64c8
[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
15 #ifdef __GNUC__
16 # define _unused_ __attribute__((__unused__))
17 # define _noreturn_ __attribute__((__noreturn__))
18 # define _printflike_(fmtarg, firstvararg) \
19 __attribute__((__format__ (__printf__, fmtarg, firstvararg) ))
20 #else
21 # define _unused_
22 # define _noreturn_
23 # define _printflike_(fmtarg, firstvararg)
24 #endif
25
26 #if __GNUC__ == 2
27 # define inline __inline__
28 #else
29 # ifdef __TenDRA__
30 # define inline __inline
31 # endif
32 #endif
33
34 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901
35 #define restrict __restrict
36 #endif
37
38 #ifndef max
39 # define max(a,b) ((a) > (b) ? (a) : (b))
40 #endif
41
42 #ifndef min
43 # define min(a,b) ((a) < (b) ? (a) : (b))
44 #endif
45
46 /* vim:set ts=3 sw=3 tw=78 expandtab: */