From 3eadffad0f7a3eba21bd88181f450c14d5050cf5 Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Mon, 10 Feb 2020 15:48:16 -0500 Subject: [PATCH] Add static assert macro ENV_BUILD_BUG_ON to posix env Signed-off-by: Adam Rutkowski --- env/posix/ocf_env.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/env/posix/ocf_env.h b/env/posix/ocf_env.h index d255174..c175c31 100644 --- a/env/posix/ocf_env.h +++ b/env/posix/ocf_env.h @@ -71,6 +71,8 @@ typedef uint64_t sector_t; #define ENV_BUG() assert(0) #define ENV_BUG_ON(cond) do { if (cond) ENV_BUG(); } while (0) +#define ENV_BUILD_BUG_ON(cond) _Static_assert(!(cond), "static "\ + "assertion failure") /* MISC UTILITIES */ #define container_of(ptr, type, member) ({ \