From 832f5800545d0cde6de3e39a0d2e57a5849aea48 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 30 Sep 2004 10:18:07 +0000 Subject: [PATCH] Add CTASSERT, a facility for simple compile time assertions. This is useful to ensure that certain structures keep there size. Obtained-from: FreeBSD --- sys/sys/systm.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index b89e5587e0..6a18c329d2 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -37,7 +37,7 @@ * * @(#)systm.h 8.7 (Berkeley) 3/29/95 * $FreeBSD: src/sys/sys/systm.h,v 1.111.2.18 2002/12/17 18:04:02 sam Exp $ - * $DragonFly: src/sys/sys/systm.h,v 1.21 2004/09/19 02:52:27 dillon Exp $ + * $DragonFly: src/sys/sys/systm.h,v 1.22 2004/09/30 10:18:07 joerg Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -104,6 +104,10 @@ extern int clocks_running; /* timing/timeout subsystem is operational */ #define CONDSPLASSERT(cond, level, msg) #endif +#define CTASSERT(x) _CTASSERT(x, __LINE__) +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] + /* * General function declarations. */ -- 2.41.0