about summary refs log tree commit diff
path: root/src/misc/bswap_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/bswap_64.c')
-rw-r--r--src/misc/bswap_64.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/misc/bswap_64.c b/src/misc/bswap_64.c
new file mode 100644
index 00000000..961300b5
--- /dev/null
+++ b/src/misc/bswap_64.c
@@ -0,0 +1,9 @@
+#include <endian.h>
+#include <stdint.h>
+
+uint32_t bswap_32(uint32_t);
+
+uint64_t bswap_64(uint64_t x)
+{
+	return bswap_32(x)+0LL<<32 | bswap_32(x>>32);
+}