summaryrefslogtreecommitdiff
path: root/util/endian.h
diff options
context:
space:
mode:
Diffstat (limited to 'util/endian.h')
-rw-r--r--util/endian.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/endian.h b/util/endian.h
new file mode 100644
index 0000000..014703f
--- /dev/null
+++ b/util/endian.h
@@ -0,0 +1,7 @@
+#include <stdint.h>
+
+static const uint16_t be_test = 1;
+#define is_big_endian() ((* (char *) &be_test) == 0)
+
+//returns bytes in little endian order (smallest first)
+uint8_t *bytes_le_order(uint64_t in);