mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 09:20:23 +01:00
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:
parent
be8be0f091
commit
2c2ed2374f
1 changed files with 1 additions and 1 deletions
|
|
@ -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)); \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue