Skip to content

Commit 37d4ba4

Browse files
phirsovthiagomacieira
authored andcommitted
Protect macro argument expansion using parentheses
Fixes #141 Signed-off-by: phirsov <[email protected]>
1 parent 3f0a830 commit 37d4ba4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compilersupport_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
# define cbor_ntohs __builtin_bswap16
107107
# define cbor_htons __builtin_bswap16
108108
# else
109-
# define cbor_ntohs(x) (((uint16_t)x >> 8) | ((uint16_t)x << 8))
109+
# define cbor_ntohs(x) (((uint16_t)(x) >> 8) | ((uint16_t)(x) << 8))
110110
# define cbor_htons cbor_ntohs
111111
# endif
112112
# else

0 commit comments

Comments
 (0)