summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/sys/debug.h')
-rw-r--r--usr/src/uts/common/sys/debug.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/usr/src/uts/common/sys/debug.h b/usr/src/uts/common/sys/debug.h
index 27b84beb88..8efc8956b6 100644
--- a/usr/src/uts/common/sys/debug.h
+++ b/usr/src/uts/common/sys/debug.h
@@ -27,6 +27,7 @@
/*
* Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright 2013 Saso Kiselkov. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -124,6 +125,14 @@ _NOTE(CONSTCOND) } while (0)
#define ASSERT0(x) ((void)0)
#endif
+/*
+ * Compile-time assertion. The condition 'x' must be constant.
+ */
+#define CTASSERT(x) _CTASSERT(x, __LINE__)
+#define _CTASSERT(x, y) __CTASSERT(x, y)
+#define __CTASSERT(x, y) \
+ typedef char __compile_time_assertion__ ## y [(x) ? 1 : -1]
+
#ifdef _KERNEL
extern void abort_sequence_enter(char *);