path: root/mcon/U/Assert.U
diff options
Diffstat (limited to 'mcon/U/Assert.U')
1 files changed, 26 insertions, 0 deletions
diff --git a/mcon/U/Assert.U b/mcon/U/Assert.U
new file mode 100644
index 0000000..ef43d59
--- /dev/null
+++ b/mcon/U/Assert.U
@@ -0,0 +1,26 @@
+?RCS: Copyright (c) 2012 Raphael Manfredi
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?MAKE:Assert: cat
+?MAKE: -pick add $@ %<
+: static assertion checking include file
+?X: C programs can include this file to perform STATIC_ASSERT() checks
+?X: which are done at compile-time and cause the compilation to fail when
+?X: the expression is false.
+?X: It is sufficient to compile with: $cc -c $ccflags try.c
+?X: There is no need to link the file to spot the assertion failure.
+$cat >static_assert.h <<'EOC'
+#define STATIC_ASSERT(expr) \
+ do { switch (0) { case ((expr) ? 1 : 0): case 0: break; } } while(0)