]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix compilation for MinGW with wxUSE_IPV6==1.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 Mar 2013 15:08:13 +0000 (15:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 Mar 2013 15:08:13 +0000 (15:08 +0000)
MinGW doesn't provide wspiapi.h header, so only include it when using MSVC and
include ws2tcpip.h which directly declares the functions used for the other
compilers.

This doesn't have quite the same semantics but it's better than failing to
compile at all.

See #15005.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/sckaddr.cpp

index ec572a2adb26a7fbab000ca68cad1a18c7e25164..3d25f931549c73fc498321011dd903ef32bf43a3 100644 (file)
@@ -92,19 +92,20 @@ IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress)
     #define wxHAS_MT_SAFE_GETBY_FUNCS
 
     #if wxUSE_IPV6
-        // this header does dynamic dispatching of getaddrinfo/freeaddrinfo()
-        // by implementing them in its own code if the system versions are not
-        // available (as is the case for anything < XP)
-        //
-        // NB: if this is not available for the other compilers (so far tested
-        //      with MSVC only) we should just use wxDynamicLibrary "manually"
         #ifdef __VISUALC__
-            // disable a warning occurring in Microsoft own version of this file
+            // this header does dynamic dispatching of getaddrinfo/freeaddrinfo()
+            // by implementing them in its own code if the system versions are
+            // not available (as is the case for anything < XP)
+            #pragma warning(push)
             #pragma warning(disable:4706)
-        #endif
-        #include <wspiapi.h>
-        #ifdef __VISUALC__
-            #pragma warning(default:4706)
+            #include <wspiapi.h>
+            #pragma warning(pop)
+        #else
+            // TODO: Use wxDynamicLibrary to bind to these functions
+            //       dynamically on older Windows systems, currently a program
+            //       built with wxUSE_IPV6==1 won't even start there, even if
+            //       it doesn't actually use the socket stuff.
+            #include <ws2tcpip.h>
         #endif
     #endif
 #endif // __WINDOWS__