2 * copyright (c) 2001-2014 Emil Mikulic.
4 * cdefs.h: compiler-specific defines
6 * This file borrows from FreeBSD's sys/cdefs.h
10 # define _unused_ __attribute__((__unused__))
11 # define _noreturn_ __attribute__((__noreturn__))
12 # define _printflike_(fmtarg, firstvararg) \
13 __attribute__((__format__ (__printf__, fmtarg, firstvararg) ))
17 # define _printflike_(fmtarg, firstvararg)
21 # define inline __inline__
24 # define inline __inline
28 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901
29 # define restrict __restrict
33 # define MAX(a,b) ((a) > (b) ? (a) : (b))
37 # define MIN(a,b) ((a) < (b) ? (a) : (b))
40 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
42 # define _Static_assert(x, y) __Static_assert(x, __COUNTER__)
44 # define _Static_assert(x, y) __Static_assert(x, __LINE__)
46 # define __Static_assert(x, y) ___Static_assert(x, y)
47 # define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1]
50 /* vim:set ts=3 sw=3 tw=78 expandtab: */