summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/NetworkInterfaceEnum.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2016-11-07 23:15:07 +0100
committerAlexander Harkness <me@bearbin.net>2016-12-12 15:32:32 +0100
commit8c6d0b51c719e1817e308375d129b17ede3b82fc (patch)
tree8aa23d1db5e4198f6aeed5091ad6adedc12fea35 /src/OSSupport/NetworkInterfaceEnum.cpp
parentMerge pull request #3476 from Seadragon91/patch-1 (diff)
downloadcuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.gz
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.bz2
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.lz
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.xz
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.tar.zst
cuberite-8c6d0b51c719e1817e308375d129b17ede3b82fc.zip
Diffstat (limited to 'src/OSSupport/NetworkInterfaceEnum.cpp')
-rw-r--r--src/OSSupport/NetworkInterfaceEnum.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/OSSupport/NetworkInterfaceEnum.cpp b/src/OSSupport/NetworkInterfaceEnum.cpp
index d3a254c23..439710c38 100644
--- a/src/OSSupport/NetworkInterfaceEnum.cpp
+++ b/src/OSSupport/NetworkInterfaceEnum.cpp
@@ -7,10 +7,10 @@
#include "Network.h"
#include "event2/util.h"
-#ifdef _WIN32
+#if defined(_WIN32)
#include <IPHlpApi.h>
#pragma comment(lib, "IPHLPAPI.lib")
-#else // _WIN32
+#elif !defined(ANDROID) // _WIN32
#include <sys/types.h>
#include <ifaddrs.h>
#include <netinet/in.h>
@@ -21,7 +21,7 @@
-#ifdef _WIN32
+#if defined(_WIN32)
/** Converts the SOCKET_ADDRESS structure received from the OS into an IP address string. */
static AString PrintAddress(SOCKET_ADDRESS & a_Addr)
@@ -50,7 +50,7 @@ static AString PrintAddress(SOCKET_ADDRESS & a_Addr)
return IP;
}
-#else // _WIN32
+#elif !defined(ANDROID) // _WIN32
static AString PrintAddress(ifaddrs * InterfaceAddress)
{
@@ -82,7 +82,7 @@ static AString PrintAddress(ifaddrs * InterfaceAddress)
}
}
-#endif // else _WIN32
+#endif // else !ANDROID
@@ -92,7 +92,7 @@ AStringVector cNetwork::EnumLocalIPAddresses(void)
{
AStringVector res;
- #ifdef _WIN32
+ #if defined(_WIN32)
// Query the OS for all adapters' addresses:
char buffer[64 KiB]; // A buffer backing the address list
@@ -129,7 +129,7 @@ AStringVector cNetwork::EnumLocalIPAddresses(void)
} // for pUnicast
} // for pCurrAddresses
- #else // _WIN32
+ #elif !defined(ANDROID) // _WIN32
struct ifaddrs * ifAddrStruct = nullptr;
getifaddrs(&ifAddrStruct);