Fix WUT_CHECK_ macros not being evaluated on C++.

static_assert is only defined for C11.
This commit is contained in:
James Benton 2018-07-19 08:44:58 +01:00
parent 690bd6ccbd
commit c655780c34

View File

@ -3,7 +3,7 @@
#include <stddef.h>
// Ensure structs are correct size & offsets
#if defined(static_assert)
#if defined(static_assert) || defined(__cplusplus)
# define WUT_CHECK_SIZE(Type, Size) \
static_assert(sizeof(Type) == Size, \
#Type " must be " #Size " bytes")