HomeFreeBSD

LinuxKPI: change BUILD_BUG_ON()

Description

LinuxKPI: change BUILD_BUG_ON()

BUILD_BUG_ON() can be used inside functions where the definition to
CTASSERT() (_Static_assert()) seems to not work.
Go back to an old-style CTASSERT() implementation but also add a
variable dclaration to avoid "unsued typedef" errors and dummy-use
the variable to avoid "unusued variable" errors. Given it is all
self-contained in a block and not used outside this should be
optimised away.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30431

Details

Provenance
bzAuthored on May 24 2021, 6:26 PM
Reviewer
hselasky
Differential Revision
D30431: LinuxKPI: change BUILD_BUG_ON()
Parents
rG18d303b05f28: LinuxKPI: add ktime_get_boottime_ns() implementation to ktime.h
Branches
Unknown
Tags
Unknown