mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
getLocalAddresses should not need Qt for android >= 24
This commit is contained in:
parent
a887d205e9
commit
1705a930d4
@ -26,6 +26,10 @@
|
|||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
#endif // WINDOWS_SYS
|
#endif // WINDOWS_SYS
|
||||||
|
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
# include <android/api-level.h>
|
||||||
|
#endif // def __ANDROID__
|
||||||
|
|
||||||
#include "pqi/pqinetwork.h"
|
#include "pqi/pqinetwork.h"
|
||||||
#include "util/rsnet.h"
|
#include "util/rsnet.h"
|
||||||
|
|
||||||
@ -272,7 +276,7 @@ int inet_aton(const char *name, struct in_addr *addr)
|
|||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <iphlpapi.h>
|
# include <iphlpapi.h>
|
||||||
# pragma comment(lib, "IPHLPAPI.lib")
|
# pragma comment(lib, "IPHLPAPI.lib")
|
||||||
#elif defined(__ANDROID__)
|
#elif defined(__ANDROID__) && __ANDROID_API__ < 24
|
||||||
# include <string>
|
# include <string>
|
||||||
# include <QString>
|
# include <QString>
|
||||||
# include <QHostAddress>
|
# include <QHostAddress>
|
||||||
@ -320,7 +324,7 @@ bool getLocalAddresses(std::vector<sockaddr_storage>& addrs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(adapter_addresses);
|
free(adapter_addresses);
|
||||||
#elif defined(__ANDROID__)
|
#elif defined(__ANDROID__) && __ANDROID_API__ < 24
|
||||||
foreach(QHostAddress qAddr, QNetworkInterface::allAddresses())
|
foreach(QHostAddress qAddr, QNetworkInterface::allAddresses())
|
||||||
{
|
{
|
||||||
sockaddr_storage tmpAddr;
|
sockaddr_storage tmpAddr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user