projects
/
project
/
libubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add pkgconfig support for json-c
[project/libubox.git]
/
utils.h
diff --git
a/utils.h
b/utils.h
index
41ea02c
..
71a4692
100644
(file)
--- a/
utils.h
+++ b/
utils.h
@@
-99,7
+99,7
@@
void clock_gettime(int type, struct timespec *tv);
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#endif
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#endif
-#define __u_bswap16(x) (
(uint16_t)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
)
+#define __u_bswap16(x) (
{ uint16_t val = (x); ((uint16_t)(((val >> 8) & 0xffu) | ((val & 0xffu) << 8))); }
)
#if _GNUC_MIN_VER(4, 2)
#define __u_bswap32(x) __builtin_bswap32(x)
#if _GNUC_MIN_VER(4, 2)
#define __u_bswap32(x) __builtin_bswap32(x)