Add static assert macro ENV_BUILD_BUG_ON to posix env

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski 2020-02-10 15:48:16 -05:00
parent fabd41250b
commit 3eadffad0f

2
env/posix/ocf_env.h vendored
View File

@ -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) ({ \