ecere/drivers/Android: Tweaks to run with latest Android SDK/NDK on Nexus 9
[sdk] / ecere / src / net / Service.ec
index c20b823..3b5af5a 100644 (file)
@@ -1,5 +1,8 @@
-#define __statement __extension__   // To compile for Android/X86 (Need to add support to eC)
-                                    // Also had to add __extension__ to __swap16md macro in endian.h
+#ifdef __statement
+#undef __statement
+#endif
+#define __statement(x) __extension__(x)  // To compile for Android/X86 (Need to add support to eC)
+                                         // Also had to add __extension__ to __swap16md macro in endian.h
 namespace net;
 
 #ifndef ECERE_NONET
@@ -41,6 +44,14 @@ typedef struct in_addr IN_ADDR;
 
 import "network"
 
+#ifdef __ANDROID__
+// TOFIX:
+#undef ntohs
+#undef htons
+#define ntohs(x) (x)
+#define htons(x) (x)
+#endif
+
 public class Service
 {
 public: