This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[UTIL] Perl system does not default to $_
[metaconfig.git] / dist / U / Assert.U
CommitLineData
d8875586
MBT
1?RCS:
2?RCS: Copyright (c) 2012 Raphael Manfredi
3?RCS:
4?RCS: You may redistribute only under the terms of the Artistic Licence,
5?RCS: as specified in the README file that comes with the distribution.
6?RCS: You may reuse parts of this distribution only within the terms of
7?RCS: that same Artistic Licence; a copy of which may be found at the root
8?RCS: of the source tree for dist 4.0.
9?RCS:
10?MAKE:Assert: cat
11?MAKE: -pick add $@ %<
12?F:./static_assert.h
13: static assertion checking include file
14?X:
15?X: C programs can include this file to perform STATIC_ASSERT() checks
16?X: which are done at compile-time and cause the compilation to fail when
17?X: the expression is false.
18?X:
19?X: It is sufficient to compile with: $cc -c $ccflags try.c
20?X: There is no need to link the file to spot the assertion failure.
21?X:
22$cat >static_assert.h <<'EOC'
23#define STATIC_ASSERT(expr) \
24 do { switch (0) { case ((expr) ? 1 : 0): case 0: break; } } while(0)
25EOC
26