From c1591c4ef34209a14d613dcc0a0f3a3a665f5b7d Mon Sep 17 00:00:00 2001 From: rmind Date: Sun, 22 Jan 2012 02:57:36 +0000 Subject: [PATCH] Add CTASSERT_SIGNED() and CTASSERT_UNSIGNED(). --- sys/lib/libkern/libkern.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/lib/libkern/libkern.h b/sys/lib/libkern/libkern.h index e6fc8b88683f..8c1bec9854d2 100644 --- a/sys/lib/libkern/libkern.h +++ b/sys/lib/libkern/libkern.h @@ -1,4 +1,4 @@ -/* $NetBSD: libkern.h,v 1.104 2011/11/28 08:05:06 tls Exp $ */ +/* $NetBSD: libkern.h,v 1.105 2012/01/22 02:57:36 rmind Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -190,6 +190,8 @@ tolower(int ch) #endif #define CTASSERT(x) __CTASSERT(x) +#define CTASSERT_SIGNED(x) __CTASSERT(((typeof(x))-1) < 0) +#define CTASSERT_UNSIGNED(x) __CTASSERT(((typeof(x))-1) >= 0) #ifndef DIAGNOSTIC #define _DIAGASSERT(a) (void)0