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 MAX(a,b) ((a) > (b) ? (a) : (b))
25 # define MIN(a,b) ((a) < (b) ? (a) : (b))
28 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
30 # define _Static_assert(x, y) __Static_assert(x, __COUNTER__)
32 # define _Static_assert(x, y) __Static_assert(x, __LINE__)
34 # define __Static_assert(x, y) ___Static_assert(x, y)
35 # define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1]
38 /* vim:set ts=3 sw=3 tw=78 expandtab: */