svn commit: r228478 - head/sys/sys

Ed Schouten ed at FreeBSD.org
Tue Dec 13 19:39:25 UTC 2011


Author: ed
Date: Tue Dec 13 19:39:24 2011
New Revision: 228478
URL: http://svn.freebsd.org/changeset/base/228478

Log:
  Reimplement CTASSERT() using _Static_assert().

Modified:
  head/sys/sys/systm.h

Modified: head/sys/sys/systm.h
==============================================================================
--- head/sys/sys/systm.h	Tue Dec 13 19:37:27 2011	(r228477)
+++ head/sys/sys/systm.h	Tue Dec 13 19:39:24 2011	(r228478)
@@ -92,10 +92,8 @@ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUES
 } while (0)
 #endif
 
-#ifndef CTASSERT		/* Allow lint to override */
-#define	CTASSERT(x)		_CTASSERT(x, __LINE__)
-#define	_CTASSERT(x, y)		__CTASSERT(x, y)
-#define	__CTASSERT(x, y)	typedef char __assert ## y[(x) ? 1 : -1]
+#ifndef CTASSERT	/* Allow lint to override */
+#define	CTASSERT(x)	_Static_assert(x, "compile-time assertion failed")
 #endif
 
 /*


More information about the svn-src-all mailing list