Fix static assert for C++ (disable them totally as static_assert doesn't work -- It can't be used in expressions)

This commit is contained in:
Patrick Pelissier committed 2019-11-30 00:08:59 +01:00
1 parent a79b67cea2
commit ffed880e0a
1 file changed
+4 -1
+4 -1
View File
@@ -2557,8 +2557,11 @@ m_core_hash (const void *str, size_t length)
/* Force a compilation error if condition is false
In this case, it raises "error: negative width in bit-field <anonymous>" */
#if defined(__cplusplus)
#define M_STATIC_ASSERT(_e) (assert(_e))
#else
#define M_STATIC_ASSERT(_e) ((void) sizeof(struct { int a:1; int :-!(_e); }))
#endif
/************************************************************/