Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jun 2020 10:45:31 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r362314 - stable/12/sys/compat/linuxkpi/common/include/linux
Message-ID:  <202006181045.05IAjV5O081895@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Jun 18 10:45:30 2020
New Revision: 362314
URL: https://svnweb.freebsd.org/changeset/base/362314

Log:
  MFC r361722:
  Implement BUILD_BUG_ON_ZERO() in the LinuxKPI.
  Tested using gcc and clang.
  
  Sponsored by:	Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h
==============================================================================
--- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h	Thu Jun 18 10:41:51 2020	(r362313)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h	Thu Jun 18 10:45:30 2020	(r362314)
@@ -94,6 +94,9 @@
 #define	BUILD_BUG_ON_NOT_POWER_OF_2(x)	BUILD_BUG_ON(!powerof2(x))
 #define	BUILD_BUG_ON_INVALID(expr)	while (0) { (void)(expr); }
 
+extern const volatile int lkpi_build_bug_on_zero;
+#define	BUILD_BUG_ON_ZERO(x)	((x) ? lkpi_build_bug_on_zero : 0)
+
 #define	BUG()			panic("BUG at %s:%d", __FILE__, __LINE__)
 #define	BUG_ON(cond)		do {				\
 	if (cond) {						\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006181045.05IAjV5O081895>