Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libkern Add CTASSERT_SIGNED() and CTASSERT_UNSIGNED().



details:   https://anonhg.NetBSD.org/src/rev/f9e8cb7efc23
branches:  trunk
changeset: 772938:f9e8cb7efc23
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Jan 22 02:57:36 2012 +0000

description:
Add CTASSERT_SIGNED() and CTASSERT_UNSIGNED().

diffstat:

 sys/lib/libkern/libkern.h |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r a9ef439997bf -r f9e8cb7efc23 sys/lib/libkern/libkern.h
--- a/sys/lib/libkern/libkern.h Sun Jan 22 02:55:47 2012 +0000
+++ b/sys/lib/libkern/libkern.h Sun Jan 22 02:57:36 2012 +0000
@@ -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 @@
 #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



Home | Main Index | Thread Index | Old Index