lib/binary: redirect 32 bits endianess functions on Android
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 30 May 2015 17:46:37 +0000 (13:46 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 2 Jun 2015 15:45:15 +0000 (11:45 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/binary/binary.nit

index 59ec88d..10d9017 100644 (file)
@@ -45,10 +45,13 @@ in "C" `{
        #include <endian.h>
 
        // Android compatibility
+       #ifndef be32toh
+               #define be32toh(val) betoh32(val)
+               #define le32toh(val) letoh32(val)
+       #endif
+
        #ifndef be64toh
                #define be64toh(val) betoh64(val)
-       #endif
-       #ifndef le64toh
                #define le64toh(val) letoh64(val)
        #endif
 `}