From 1705a930d4293b1dd1eca9b9a8da6434bae78fa9 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Wed, 25 Sep 2019 22:15:07 +0200 Subject: [PATCH] getLocalAddresses should not need Qt for android >= 24 --- libretroshare/src/pqi/pqinetwork.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/pqi/pqinetwork.cc b/libretroshare/src/pqi/pqinetwork.cc index a3f4ac47f..e2251ed6a 100644 --- a/libretroshare/src/pqi/pqinetwork.cc +++ b/libretroshare/src/pqi/pqinetwork.cc @@ -26,6 +26,10 @@ # include #endif // WINDOWS_SYS +#ifdef __ANDROID__ +# include +#endif // def __ANDROID__ + #include "pqi/pqinetwork.h" #include "util/rsnet.h" @@ -272,7 +276,7 @@ int inet_aton(const char *name, struct in_addr *addr) # include # include # pragma comment(lib, "IPHLPAPI.lib") -#elif defined(__ANDROID__) +#elif defined(__ANDROID__) && __ANDROID_API__ < 24 # include # include # include @@ -320,7 +324,7 @@ bool getLocalAddresses(std::vector& addrs) } } free(adapter_addresses); -#elif defined(__ANDROID__) +#elif defined(__ANDROID__) && __ANDROID_API__ < 24 foreach(QHostAddress qAddr, QNetworkInterface::allAddresses()) { sockaddr_storage tmpAddr;