From ed78509a7b02139827c54297d23001e9d13fb5d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Thu, 18 Feb 2016 12:34:09 -0500 Subject: [PATCH] nitc: do not define be32toh when it exists on Android MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- src/compiler/abstract_compiler.nit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/abstract_compiler.nit b/src/compiler/abstract_compiler.nit index 3cba054..347aa11 100644 --- a/src/compiler/abstract_compiler.nit +++ b/src/compiler/abstract_compiler.nit @@ -668,7 +668,9 @@ abstract class AbstractCompiler self.header.add_decl(" #define be32toh(val) ((be16toh((val) << 16) | (be16toh((val) >> 16))))") self.header.add_decl("#endif") self.header.add_decl("#ifdef ANDROID") - self.header.add_decl(" #define be32toh(val) betoh32(val)") + self.header.add_decl(" #ifndef be32toh") + self.header.add_decl(" #define be32toh(val) betoh32(val)") + self.header.add_decl(" #endif") self.header.add_decl(" #include ") self.header.add_decl(" #define PRINT_ERROR(...) (void)__android_log_print(ANDROID_LOG_WARN, \"Nit\", __VA_ARGS__)") self.header.add_decl("#else") -- 1.7.9.5