File: ctassert.h

package info (click to toggle)
spiped 1.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,328 kB
  • sloc: ansic: 11,951; sh: 1,081; makefile: 629; perl: 121
file content (20 lines) | stat: -rw-r--r-- 588 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
#ifndef CTASSERT_H_
#define CTASSERT_H_

/*
 * CTASSERT(foo) will produce a compile-time error if "foo" is not a constant
 * expression which evaluates to a non-zero value.
 */

/* Kill any existing definition, just in case it's different. */
#ifdef CTASSERT
#undef CTASSERT
#endif

/* Define using libcperciva namespace to avoid collisions. */
#define CTASSERT(x)			libcperciva_CTASSERT(x, __LINE__)
#define libcperciva_CTASSERT(x, y)	libcperciva__CTASSERT(x, y)
#define libcperciva__CTASSERT(x, y)					\
    extern char libcperciva__assert ## y[(x) ? 1 : -1]

#endif /* !CTASSERT_H_ */