mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 02:58:01 +02:00
_dbus_test_check: Wrap body of macro in do/while
This avoids unexpected precedence when used as the body of an "if" or
"else" without being wrapped in {}.
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
0ddc510130
commit
c46e002fe6
1 changed files with 4 additions and 1 deletions
|
|
@ -59,7 +59,10 @@ void _dbus_test_check_memleaks (const char *test_name);
|
|||
DBUS_PRIVATE_EXPORT
|
||||
int _dbus_test_done_testing (void);
|
||||
|
||||
#define _dbus_test_check(a) if (!(a)) _dbus_test_not_ok ("%s:%d - '%s' failed\n", __FILE__, __LINE__, #a)
|
||||
#define _dbus_test_check(a) do { \
|
||||
if (!(a)) \
|
||||
_dbus_test_not_ok ("%s:%d - '%s' failed\n", __FILE__, __LINE__, #a); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue