]> granicus.if.org Git - strace/blobdiff - tests/xstatfsx.c
tests: extend TEST_NETLINK_OBJECT macro
[strace] / tests / xstatfsx.c
index 4b4c0c8ce29c4b2addb6ddc51ecc66e6d6e94d0e..33254dd9078e9af18d079763c217db6123b1d4d4 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2016-2017 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #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)