aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_byteorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/mhd_byteorder.h')
-rw-r--r--src/microhttpd/mhd_byteorder.h47
1 files changed, 27 insertions, 20 deletions
diff --git a/src/microhttpd/mhd_byteorder.h b/src/microhttpd/mhd_byteorder.h
index f053aa0e..f1f03f44 100644
--- a/src/microhttpd/mhd_byteorder.h
+++ b/src/microhttpd/mhd_byteorder.h
@@ -73,7 +73,8 @@
73#if defined(__BYTE_ORDER__) 73#if defined(__BYTE_ORDER__)
74#if defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 74#if defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
75#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN 75#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
76#elif defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 76#elif defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == \
77 __ORDER_LITTLE_ENDIAN__
77#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN 78#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
78#elif defined(__ORDER_PDP_ENDIAN__) && __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__ 79#elif defined(__ORDER_PDP_ENDIAN__) && __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
79#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN 80#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN
@@ -108,36 +109,40 @@
108/* Byte order specification didn't detected in system headers */ 109/* Byte order specification didn't detected in system headers */
109/* Try some guessing */ 110/* Try some guessing */
110 111
111#if (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \ 112#if (defined(__BIG_ENDIAN__) && ! defined(__LITTLE_ENDIAN__)) || \
112 (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) 113 (defined(_BIG_ENDIAN) && ! defined(_LITTLE_ENDIAN))
113/* Seems that we are on big endian platform */ 114/* Seems that we are on big endian platform */
114#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN 115#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
115#elif (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ 116#elif (defined(__LITTLE_ENDIAN__) && ! defined(__BIG_ENDIAN__)) || \
116 (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) 117 (defined(_LITTLE_ENDIAN) && ! defined(_BIG_ENDIAN))
117/* Seems that we are on little endian platform */ 118/* Seems that we are on little endian platform */
118#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN 119#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
119#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || \ 120#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || \
120 defined(_M_X64) || defined(_M_AMD64) || defined(i386) || defined(__i386) || \ 121 defined(__x86_64) || \
121 defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || \ 122 defined(_M_X64) || defined(_M_AMD64) || defined(i386) || defined(__i386) || \
122 defined(_M_IX86) || defined(_X86_) || defined (__THW_INTEL__) 123 defined(__i386__) || defined(__i486__) || defined(__i586__) || \
124 defined(__i686__) || \
125 defined(_M_IX86) || defined(_X86_) || defined (__THW_INTEL__)
123/* x86 family is little endian */ 126/* x86 family is little endian */
124#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN 127#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
125#elif defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \ 128#elif defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \
126 defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) 129 defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
127/* Looks like we are on ARM/MIPS in big endian mode */ 130/* Looks like we are on ARM/MIPS in big endian mode */
128#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN 131#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
129#elif defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \ 132#elif defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \
130 defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) 133 defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__)
131/* Looks like we are on ARM/MIPS in little endian mode */ 134/* Looks like we are on ARM/MIPS in little endian mode */
132#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN 135#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
133#elif defined(__m68k__) || defined(M68000) || defined(__hppa__) || defined(__hppa) || \ 136#elif defined(__m68k__) || defined(M68000) || defined(__hppa__) || \
134 defined(__HPPA__) || defined(__370__) || defined(__THW_370__) || \ 137 defined(__hppa) || \
135 defined(__s390__) || defined(__s390x__) || defined(__SYSC_ZARCH__) 138 defined(__HPPA__) || defined(__370__) || defined(__THW_370__) || \
139 defined(__s390__) || defined(__s390x__) || defined(__SYSC_ZARCH__)
136/* Looks like we are on big endian platform */ 140/* Looks like we are on big endian platform */
137#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN 141#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN
138#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || defined(__ia64) || \ 142#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || \
139 defined(_M_IA64) || defined(__itanium__) || defined(__bfin__) || \ 143 defined(__ia64) || \
140 defined(__BFIN__) || defined(bfin) || defined(BFIN) 144 defined(_M_IA64) || defined(__itanium__) || defined(__bfin__) || \
145 defined(__BFIN__) || defined(bfin) || defined(BFIN)
141/* Looks like we are on little endian platform */ 146/* Looks like we are on little endian platform */
142#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN 147#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN
143#elif defined(_WIN32) 148#elif defined(_WIN32)
@@ -153,9 +158,11 @@
153#ifdef _MHD_BYTE_ORDER 158#ifdef _MHD_BYTE_ORDER
154/* Some safety checks */ 159/* Some safety checks */
155#if defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN 160#if defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN
156#error Configure detected big endian byte order but headers specify different byte order 161#error \
157#elif !defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN 162 Configure detected big endian byte order but headers specify different byte order
158#error Configure did not detect big endian byte order but headers specify big endian byte order 163#elif ! defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN
164#error \
165 Configure did not detect big endian byte order but headers specify big endian byte order
159#endif /* !WORDS_BIGENDIAN && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN */ 166#endif /* !WORDS_BIGENDIAN && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN */
160#endif /* _MHD_BYTE_ORDER */ 167#endif /* _MHD_BYTE_ORDER */
161 168