aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/byteorder.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/byteorder.h b/include/byteorder.h
index 3ad4dd1..60ca672 100644
--- a/include/byteorder.h
+++ b/include/byteorder.h
@@ -37,6 +37,24 @@ bswap_64 (uint64_t x)
return __builtin_bswap64(x);
}
+static inline void
+bswap_16p (uint16_t *x)
+{
+ *x = __builtin_bswap16(*x);
+}
+
+static inline void
+bswap_32p (uint32_t *x)
+{
+ *x = __builtin_bswap32(*x);
+}
+
+static inline void
+bswap_64p (uint64_t *x)
+{
+ *x = __builtin_bswap64(*x);
+}
+
/* gcc defines __BIG_ENDIAN__ on big endian targets */
#ifdef __BIG_ENDIAN__