Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys Add __CTASSERT(x)
details: https://anonhg.NetBSD.org/src/rev/2e5f0d4af0d8
branches: trunk
changeset: 762306:2e5f0d4af0d8
user: matt <matt%NetBSD.org@localhost>
date: Sat Feb 19 02:01:46 2011 +0000
description:
Add __CTASSERT(x)
diffstat:
sys/sys/cdefs.h | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diffs (23 lines):
diff -r 63495efb933a -r 2e5f0d4af0d8 sys/sys/cdefs.h
--- a/sys/sys/cdefs.h Sat Feb 19 01:12:39 2011 +0000
+++ b/sys/sys/cdefs.h Sat Feb 19 02:01:46 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.82 2011/02/18 21:06:12 matt Exp $ */
+/* $NetBSD: cdefs.h,v 1.83 2011/02/19 02:01:46 matt Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -126,6 +126,13 @@
#endif
/*
+ * Compile Time Assertion.
+ */
+#define __CTASSERT(x) __CTASSERT0(x, __ctassert, __LINE__)
+#define __CTASSERT0(x, y, z) __CTASSERT1(x, y, z)
+#define __CTASSERT1(x, y, z) typedef char y ## z[(x) ? 1 : -1];
+
+/*
* The following macro is used to remove const cast-away warnings
* from gcc -Wcast-qual; it should be used with caution because it
* can hide valid errors; in particular most valid uses are in
Home |
Main Index |
Thread Index |
Old Index