File: cdefs.h

package info (click to toggle)
darkstat 3.0.719-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 888 kB
  • sloc: ansic: 6,946; sh: 530; makefile: 175; php: 15
file content (38 lines) | stat: -rw-r--r-- 999 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* darkstat 3
 * copyright (c) 2001-2014 Emil Mikulic.
 *
 * cdefs.h: compiler-specific defines
 *
 * This file borrows from FreeBSD's sys/cdefs.h
 */

#ifdef __GNUC__
# define _unused_ __attribute__((__unused__))
# define _noreturn_ __attribute__((__noreturn__))
# define _printflike_(fmtarg, firstvararg) \
   __attribute__((__format__ (__printf__, fmtarg, firstvararg) ))
#else
# define _unused_
# define _noreturn_
# define _printflike_(fmtarg, firstvararg)
#endif

#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif

#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif

#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
# ifdef __COUNTER__
#  define _Static_assert(x, y)    __Static_assert(x, __COUNTER__)
# else
#  define _Static_assert(x, y)    __Static_assert(x, __LINE__)
# endif
# define __Static_assert(x, y)   ___Static_assert(x, y)
# define ___Static_assert(x, y)  typedef char __assert_ ## y[(x) ? 1 : -1]
#endif

/* vim:set ts=3 sw=3 tw=78 expandtab: */