]> granicus.if.org Git - strace/blobdiff - ipc_defs.h
nlattr: add unsigned int decoders that print in hex form
[strace] / ipc_defs.h
index 0ece103188dbd2a5512e9a1e7fbee114f78b879d..568a3ef8d3e443043681b8173425c92dd1421723 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2003 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2003-2017 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 # define IPC_64 0x100
 #endif
 
-#define PRINTCTL(flagset, arg, dflt) \
-       if ((arg) & IPC_64) tprints("IPC_64|"); \
-       printxval((flagset), (arg) &~ IPC_64, dflt)
+#define PRINTCTL(flagset, arg, dflt)                           \
+       do {                                                    \
+               if ((arg) & IPC_64) {                           \
+                       print_xlat(IPC_64);                     \
+                       tprints("|");                           \
+               }                                               \
+               printxval((flagset), (arg) & ~IPC_64, dflt);    \
+       } while (0)
 
-#endif /* #ifndef STRACE_IPC_DEFS_H */
+#endif /* !STRACE_IPC_DEFS_H */