Source-Changes-HG archive

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

[src/trunk]: src/sys/sys Make __CTASSERT use __COUNTER__ instead of __LINE__ ...



details:   https://anonhg.NetBSD.org/src/rev/215074e8975b
branches:  trunk
changeset: 762308:215074e8975b
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Feb 19 02:21:21 2011 +0000

description:
Make __CTASSERT use __COUNTER__ instead of __LINE__ if the cpp supports it.

diffstat:

 sys/sys/cdefs.h |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 86629f33f214 -r 215074e8975b sys/sys/cdefs.h
--- a/sys/sys/cdefs.h   Sat Feb 19 02:02:14 2011 +0000
+++ b/sys/sys/cdefs.h   Sat Feb 19 02:21:21 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdefs.h,v 1.83 2011/02/19 02:01:46 matt Exp $  */
+/*     $NetBSD: cdefs.h,v 1.84 2011/02/19 02:21:21 matt Exp $  */
 
 /*
  * Copyright (c) 1991, 1993
@@ -128,7 +128,11 @@
 /*
  * Compile Time Assertion.
  */
+#ifdef __COUNTER__
+#define        __CTASSERT(x)           __CTASSERT0(x, __ctassert, __COUNTER__)
+#else
 #define        __CTASSERT(x)           __CTASSERT0(x, __ctassert, __LINE__)
+#endif
 #define        __CTASSERT0(x, y, z)    __CTASSERT1(x, y, z)
 #define        __CTASSERT1(x, y, z)    typedef char y ## z[(x) ? 1 : -1];
 



Home | Main Index | Thread Index | Old Index