aboutsummaryrefslogtreecommitdiff
path: root/libctf/swap.h
diff options
context:
space:
mode:
Diffstat (limited to 'libctf/swap.h')
-rw-r--r--libctf/swap.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/libctf/swap.h b/libctf/swap.h
index d7cc993..4d0b48c 100644
--- a/libctf/swap.h
+++ b/libctf/swap.h
@@ -73,18 +73,20 @@ bswap_64 (uint64_t v)
/* Swap the endianness of something. */
#define swap_thing(x) \
- do { \
- _Static_assert (sizeof (x) == 1 || (sizeof (x) % 2 == 0 \
- && sizeof (x) <= 8), \
- "Invalid size, update endianness code"); \
- switch (sizeof (x)) { \
- case 2: x = bswap_16 (x); break; \
- case 4: x = bswap_32 (x); break; \
- case 8: x = bswap_64 (x); break; \
- case 1: /* Nothing needs doing */ \
- break; \
+ do \
+ { \
+ _Static_assert (sizeof (x) == 1 || (sizeof (x) % 2 == 0 \
+ && sizeof (x) <= 8), \
+ "Invalid size, update endianness code"); \
+ switch (sizeof (x)) { \
+ case 2: x = bswap_16 (x); break; \
+ case 4: x = bswap_32 (x); break; \
+ case 8: x = bswap_64 (x); break; \
+ case 1: /* Nothing needs doing */ \
+ break; \
+ } \
} \
- } while (0);
+ while (0);
#endif /* !defined(_CTF_SWAP_H) */