Sat Feb 19 02:02:14 2011 UTC ()
Define CTASSERT in terms of __CTASSERT


(matt)
diff -r1.96 -r1.97 src/sys/lib/libkern/libkern.h

cvs diff -r1.96 -r1.97 src/sys/lib/libkern/libkern.h (expand / switch to unified diff)

--- src/sys/lib/libkern/libkern.h 2011/01/26 01:02:46 1.96
+++ src/sys/lib/libkern/libkern.h 2011/02/19 02:02:14 1.97
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: libkern.h,v 1.96 2011/01/26 01:02:46 matt Exp $ */ 1/* $NetBSD: libkern.h,v 1.97 2011/02/19 02:02:14 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -182,29 +182,27 @@ tolower(int ch) @@ -182,29 +182,27 @@ tolower(int ch)
182 kern_assert("", __FILE__, __LINE__, #e)) 182 kern_assert("", __FILE__, __LINE__, #e))
183#else 183#else
184#define assert(e) (__predict_true((e)) ? (void)0 : \ 184#define assert(e) (__predict_true((e)) ? (void)0 : \
185 kern_assert("", __FILE__, __LINE__, "e")) 185 kern_assert("", __FILE__, __LINE__, "e"))
186#endif 186#endif
187#endif 187#endif
188 188
189#ifdef __COVERITY__ 189#ifdef __COVERITY__
190#ifndef DIAGNOSTIC 190#ifndef DIAGNOSTIC
191#define DIAGNOSTIC 191#define DIAGNOSTIC
192#endif 192#endif
193#endif 193#endif
194 194
195#define CTASSERT(x) _CTASSERT(x, __LINE__) 195#define CTASSERT(x) __CTASSERT(x)
196#define _CTASSERT(x, y) __CTASSERT(x, y) 
197#define __CTASSERT(x, y) typedef char __ctassert ## y[(x) ? 1 : -1]; 
198 196
199#ifndef DIAGNOSTIC 197#ifndef DIAGNOSTIC
200#define _DIAGASSERT(a) (void)0 198#define _DIAGASSERT(a) (void)0
201#ifdef lint 199#ifdef lint
202#define KASSERTMSG(e, msg) /* NOTHING */ 200#define KASSERTMSG(e, msg) /* NOTHING */
203#define KASSERT(e) /* NOTHING */ 201#define KASSERT(e) /* NOTHING */
204#else /* !lint */ 202#else /* !lint */
205#define KASSERTMSG(e, msg) ((void)0) 203#define KASSERTMSG(e, msg) ((void)0)
206#define KASSERT(e) ((void)0) 204#define KASSERT(e) ((void)0)
207#endif /* !lint */ 205#endif /* !lint */
208#else /* DIAGNOSTIC */ 206#else /* DIAGNOSTIC */
209#define _DIAGASSERT(a) assert(a) 207#define _DIAGASSERT(a) assert(a)
210#define KASSERTMSG(e, msg) do { \ 208#define KASSERTMSG(e, msg) do { \