]> granicus.if.org Git - strace/blobdiff - tests/xstatfsx.c
tests: extend TEST_NETLINK_OBJECT macro
[strace] / tests / xstatfsx.c
index cb524ff3eddaee52b03c787887388f52a2f8219f..33254dd9078e9af18d079763c217db6123b1d4d4 100644 (file)
 #include "xlat/statfs_flags.h"
 
 #define PRINT_NUM(arg)                                                 \
-       if (sizeof(b->arg) == sizeof(int))                              \
-               printf(", %s=%u", #arg, (unsigned int) b->arg);         \
-       else if (sizeof(b->arg) == sizeof(long))                                \
-               printf(", %s=%lu", #arg, (unsigned long) b->arg);       \
-       else                                                            \
-               printf(", %s=%llu", #arg, (unsigned long long) b->arg)
+       do {                                                            \
+               if (sizeof(b->arg) == sizeof(int))                      \
+                       printf(", %s=%u", #arg,                         \
+                              (unsigned int) b->arg);                  \
+               else if (sizeof(b->arg) == sizeof(long))                \
+                       printf(", %s=%lu", #arg,                        \
+                              (unsigned long) b->arg);                 \
+               else                                                    \
+                       printf(", %s=%llu", #arg,                       \
+                              (unsigned long long) b->arg);            \
+       } while (0)
 
 static void
 print_statfs_type(const char *const prefix, const unsigned int magic)