Date: Thu, 18 Jun 2020 10:46:05 +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-11@freebsd.org Subject: svn commit: r362315 - stable/11/sys/compat/linuxkpi/common/include/linux Message-ID: <202006181046.05IAk5nI081984@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Jun 18 10:46:05 2020 New Revision: 362315 URL: https://svnweb.freebsd.org/changeset/base/362315 Log: MFC r361722: Implement BUILD_BUG_ON_ZERO() in the LinuxKPI. Tested using gcc and clang. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:45:30 2020 (r362314) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Jun 18 10:46:05 2020 (r362315) @@ -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?202006181046.05IAk5nI081984>