summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Fritsch <sf@cvs.openbsd.org>2013-06-08 19:06:52 +0000
committerStefan Fritsch <sf@cvs.openbsd.org>2013-06-08 19:06:52 +0000
commit41a55873d47f9036578b951acc755a77be819dc0 (patch)
treed508695c298843d5952224a433ba2c924446f3f1 /sys
parent6f5d7d986a8441a86a60a6ff989d87fb8b2bc337 (diff)
Add CTASSERT macro, for compile time assertions
ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/lib/libkern/libkern.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/lib/libkern/libkern.h b/sys/lib/libkern/libkern.h
index a2e6efccd3f..cb9817bce7f 100644
--- a/sys/lib/libkern/libkern.h
+++ b/sys/lib/libkern/libkern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: libkern.h,v 1.29 2012/04/26 01:22:31 matthew Exp $ */
+/* $OpenBSD: libkern.h,v 1.30 2013/06/08 19:06:50 sf Exp $ */
/* $NetBSD: libkern.h,v 1.7 1996/03/14 18:52:08 christos Exp $ */
/*-
@@ -138,6 +138,9 @@ abs(int j)
#endif
#endif
+#define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \
+ __attribute__((__unused__))
+
/* Prototypes for non-quad routines. */
void __assert(const char *, const char *, int, const char *)
__attribute__ ((__noreturn__));