GH #146: NetworkInterface (windows): IP_ADAPTER_IPV4_ENABLED

- GH #146: NetworkInterface (windows): IP_ADAPTER_IPV4_ENABLED
- added Windows 8 _WIN32_WINNT macro
- removed __cplusplus version check for C++11 (not reliable)
This commit is contained in:
Aleksandar Fabijanic 2013-04-22 22:31:43 -05:00
parent 8290a59998
commit 111c2cc52a
3 changed files with 9 additions and 5 deletions

View File

@ -44,10 +44,8 @@
#define POCO_WIN32_UTF8
#if defined(__cplusplus) && (__cplusplus > 199711L)
// Define to enable C++11 support
// #define POCO_ENABLE_CPP11
#endif
// Define to disable implicit linking

View File

@ -45,7 +45,13 @@
// determine the real version
#if defined(_WIN32_WINNT_WIN7)
#if defined(_WIN32_WINNT_WIN8)
//Windows 8 _WIN32_WINNT_WIN8 (0x0602)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT _WIN32_WINNT_WIN8
#elif defined(_WIN32_WINNT_WIN7)
//Windows 7 _WIN32_WINNT_WIN7 (0x0601)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT

View File

@ -1030,13 +1030,13 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
unsigned ifIndex = 0;
#if defined(POCO_HAVE_IPv6)
#if defined (IP_ADAPTER_IPV6_ENABLED)
#if (_WIN32_WINNT >= 0x600) && defined (IP_ADAPTER_IPV6_ENABLED)
if (pAddress->Flags & IP_ADAPTER_IPV6_ENABLED) ifIndex = pAddress->Ipv6IfIndex;
#else
ifIndex = pAddress->Ipv6IfIndex;
#endif
#endif
#if defined (IP_ADAPTER_IPV4_ENABLED)
#if (_WIN32_WINNT >= 0x600) && defined (IP_ADAPTER_IPV4_ENABLED)
if (pAddress->Flags & IP_ADAPTER_IPV4_ENABLED) ifIndex = pAddress->IfIndex;
#else
ifIndex = pAddress->IfIndex;