summaryrefslogtreecommitdiffstats
path: root/include/endianness.h
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-03-19 01:44:21 +0100
committerGravatar Martin Szulecki2012-03-19 01:44:21 +0100
commit86495a1f22cd53399697dd558d65f50ed60dcdb4 (patch)
tree9583dfc734dc5d754972842b66ffa7a3e595404b /include/endianness.h
parent7677cd4a5290b6b90f09825cdb5e2945ad276dab (diff)
downloadlibimobiledevice-86495a1f22cd53399697dd558d65f50ed60dcdb4.tar.gz
libimobiledevice-86495a1f22cd53399697dd558d65f50ed60dcdb4.tar.bz2
Fix endianness detection macros and win32 is little endian too
Diffstat (limited to 'include/endianness.h')
-rw-r--r--include/endianness.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/endianness.h b/include/endianness.h
index a34cbf4..1f99fa7 100644
--- a/include/endianness.h
+++ b/include/endianness.h
@@ -1,6 +1,24 @@
#ifndef ENDIANNESS_H
#define ENDIANNESS_H
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN 1234
+#endif
+
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN 4321
+#endif
+
+#ifndef __BYTE_ORDER
+#ifdef __LITTLE_ENDIAN__
+#define __BYTE_ORDER __LITTLE_ENDIAN
+#else
+#ifdef __BIG_ENDIAN__
+#define __BYTE_ORDER __BIG_ENDIAN
+#endif
+#endif
+#endif
+
#ifndef be16toh
#if __BYTE_ORDER == __BIG_ENDIAN
#define be16toh(x) (x)