Permalink
Browse files

Fix compilation in the mingw environment

endian.h doesn't exists in mingw, and we emulate the necessary value
(i.e. BYTE_ORDER and LITTLE_ENDIAN) directly in a #ifdef __MINGW32__.
note that in mingw32 we hardcode the endianness to little endian.

Contributed-by: Henk-Jan van Tuyl
  • Loading branch information...
1 parent e74a479 commit 378d1cab6beed6a46e82410d518cbe3235801d65 @vincenthz committed Aug 20, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 cbits/bitfn.h
View
@@ -158,8 +158,13 @@ static inline void array_copy64(uint64_t *d, uint64_t *s, uint32_t nb)
}
#endif
+#ifdef __MINGW32__
+ # define LITTLE_ENDIAN 1234
+ # define BYTE_ORDER LITTLE_ENDIAN
+#else
+ # include <endian.h>
+#endif
/* big endian to cpu */
-#include <endian.h>
#if LITTLE_ENDIAN == BYTE_ORDER
# define be32_to_cpu(a) swap32(a)

0 comments on commit 378d1ca

Please sign in to comment.