diff options
Diffstat (limited to 'src/OSSupport/NetworkInterfaceEnum.cpp')
-rw-r--r-- | src/OSSupport/NetworkInterfaceEnum.cpp | 14 |
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); |