Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/common/include/asm Make BUILD_BUG_ON_INVALI...



details:   https://anonhg.NetBSD.org/src/rev/6f8791f2fdf4
branches:  trunk
changeset: 1028426:6f8791f2fdf4
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:01:37 2021 +0000

description:
Make BUILD_BUG_ON_INVALID work on bit-field expressions.

diffstat:

 sys/external/bsd/common/include/asm/bug.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r c9f2341c92b1 -r 6f8791f2fdf4 sys/external/bsd/common/include/asm/bug.h
--- a/sys/external/bsd/common/include/asm/bug.h Sun Dec 19 11:01:29 2021 +0000
+++ b/sys/external/bsd/common/include/asm/bug.h Sun Dec 19 11:01:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bug.h,v 1.1 2021/12/19 10:55:15 riastradh Exp $        */
+/*     $NetBSD: bug.h,v 1.2 2021/12/19 11:01:37 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
 #define        BUILD_BUG()             do {} while (0)
 #define        BUILD_BUG_ON(CONDITION) DRMCTASSERT(!(CONDITION))
 #define        BUILD_BUG_ON_MSG(CONDITION,MSG) DRMCTASSERT(!(CONDITION))
-#define        BUILD_BUG_ON_INVALID(EXPR)      ((void)sizeof(EXPR))
+#define        BUILD_BUG_ON_INVALID(EXPR)      ((void)sizeof((long)(EXPR)))
 
 /* XXX Rate limit?  */
 #define WARN(CONDITION, FMT, ...)                                      \



Home | Main Index | Thread Index | Old Index