Browse Source

fix for mingw

Kajetan Johannes Hammerle 2 years ago
parent
commit
9b8f21e822
1 changed files with 7 additions and 2 deletions
  1. 7 2
      include/enet.h

+ 7 - 2
include/enet.h

@@ -63,6 +63,11 @@
 // =======================================================================//
 
 #if defined(_WIN32)
+    #if _WIN32_WINNT < 0x0600
+    #undef _WIN32_WINNT
+    #define _WIN32_WINNT 0x0600
+    #endif
+
     #if defined(_MSC_VER) && defined(ENET_IMPLEMENTATION)
         #pragma warning (disable: 4267) // size_t to int conversion
         #pragma warning (disable: 4244) // 64bit to 32bit int
@@ -70,7 +75,7 @@
         #pragma warning (disable: 4146) // unary minus operator applied to unsigned type
     #endif
 
-    #ifndef ENET_NO_PRAGMA_LINK
+    #ifndef ENET_NO_PRAGMA_LINK && !defined(__MINGW32__)
     #pragma comment(lib, "ws2_32.lib")
     #pragma comment(lib, "winmm.lib")
     #endif
@@ -5099,7 +5104,7 @@ extern "C" {
             }
         }
         else {
-            if (inet_ntop(AF_INET6, &address->host, name, nameLength) == NULL) {
+            if (inet_ntop(AF_INET6, (void*)&address->host, name, nameLength) == NULL) {
                 return -1;
             }
         }