summaryrefslogtreecommitdiffstats
path: root/include
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
parent7677cd4a5290b6b90f09825cdb5e2945ad276dab (diff)
downloadlibimobiledevice-86495a1f22cd53399697dd558d65f50ed60dcdb4.tar.gz
libimobiledevice-86495a1f22cd53399697dd558d65f50ed60dcdb4.tar.bz2
Fix endianness detection macros and win32 is little endian too
Diffstat (limited to 'include')
-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 @@
1#ifndef ENDIANNESS_H 1#ifndef ENDIANNESS_H
2#define ENDIANNESS_H 2#define ENDIANNESS_H
3 3
4#ifndef __LITTLE_ENDIAN
5#define __LITTLE_ENDIAN 1234
6#endif
7
8#ifndef __BIG_ENDIAN
9#define __BIG_ENDIAN 4321
10#endif
11
12#ifndef __BYTE_ORDER
13#ifdef __LITTLE_ENDIAN__
14#define __BYTE_ORDER __LITTLE_ENDIAN
15#else
16#ifdef __BIG_ENDIAN__
17#define __BYTE_ORDER __BIG_ENDIAN
18#endif
19#endif
20#endif
21
4#ifndef be16toh 22#ifndef be16toh
5#if __BYTE_ORDER == __BIG_ENDIAN 23#if __BYTE_ORDER == __BIG_ENDIAN
6#define be16toh(x) (x) 24#define be16toh(x) (x)