Browse Source

android: fix various compilation errors

rdb 7 years ago
parent
commit
e301e5fe5e

+ 5 - 0
dtool/src/dtoolutil/filename.cxx

@@ -48,6 +48,11 @@
 #include <unistd.h>
 #include <unistd.h>
 #endif
 #endif
 
 
+#if defined(__ANDROID__) && !defined(HAVE_LOCKF)
+// Needed for flock.
+#include <sys/file.h>
+#endif
+
 TextEncoder::Encoding Filename::_filesystem_encoding = TextEncoder::E_utf8;
 TextEncoder::Encoding Filename::_filesystem_encoding = TextEncoder::E_utf8;
 
 
 TVOLATILE AtomicAdjust::Pointer Filename::_home_directory;
 TVOLATILE AtomicAdjust::Pointer Filename::_home_directory;

+ 5 - 0
panda/src/gobj/vertexDataSaveFile.cxx

@@ -23,6 +23,11 @@
 #include <errno.h>
 #include <errno.h>
 #endif  // _WIN32
 #endif  // _WIN32
 
 
+#if defined(__ANDROID__) && !defined(HAVE_LOCKF)
+// Needed for flock.
+#include <sys/file.h>
+#endif
+
 /**
 /**
  *
  *
  */
  */

+ 2 - 2
panda/src/net/connectionManager.cxx

@@ -26,7 +26,7 @@
 #elif defined(WIN32_VC) || defined(WIN64_VC)
 #elif defined(WIN32_VC) || defined(WIN64_VC)
 #include <winsock2.h>  // For gethostname()
 #include <winsock2.h>  // For gethostname()
 #include <Iphlpapi.h> // For GetAdaptersAddresses()
 #include <Iphlpapi.h> // For GetAdaptersAddresses()
-#elif defined(ANDROID)
+#elif defined(__ANDROID__)
 #include <net/if.h>
 #include <net/if.h>
 #else
 #else
 #include <net/if.h>
 #include <net/if.h>
@@ -538,7 +538,7 @@ scan_interfaces() {
     PANDA_FREE_ARRAY(addresses);
     PANDA_FREE_ARRAY(addresses);
   }
   }
 
 
-#elif defined(ANDROID)
+#elif defined(__ANDROID__)
   // TODO: implementation using netlink_socket?
   // TODO: implementation using netlink_socket?
 
 
 #else  // WIN32_VC
 #else  // WIN32_VC