shared: fix static assert in NM_MORE_ASSERT_ONCE()

NM_MORE_ASSERTS 0 means that more assertions are disabled.
NM_MORE_ASSERT_ONCE() should never be triggered when more
assertions are disabled altogether. It is thus not allowed
to called "if (NM_MORE_ASSERT_ONCE (0))", because that code
would always be enabled.
This commit is contained in:
Thomas Haller 2020-04-10 08:11:51 +02:00
parent be8be0f091
commit 2c2ed2374f

View file

@ -1046,7 +1046,7 @@ nm_str_realloc (char *str)
&& ({ \
static volatile int _assert_once = 0; \
\
G_STATIC_ASSERT_EXPR ((more_assert_level) >= 0); \
G_STATIC_ASSERT_EXPR ((more_assert_level) > 0); \
\
G_UNLIKELY ( _assert_once == 0 \
&& g_atomic_int_compare_and_exchange (&_assert_once, 0, 1)); \