Merge branch 'master' of github.com:novacoin-project/novacoin
authorCryptoManiac <balthazar@yandex.ru>
Sun, 7 Dec 2014 02:11:59 +0000 (06:11 +0400)
committerCryptoManiac <balthazar@yandex.ru>
Sun, 7 Dec 2014 02:11:59 +0000 (06:11 +0400)
src/stun.cpp

index f724eaa..4bf2c94 100644 (file)
 #include <arpa/inet.h>
 #include <netdb.h>
 #endif
-#ifndef _MSC_VER
+#ifndef WIN32
 #include <unistd.h>
-#else
-#include <io.h>
 #endif
 #include <time.h>
 #include <errno.h>
@@ -509,10 +507,10 @@ static int StunRequest(const char *host, uint16_t port, struct sockaddr_in *mapp
     int rc = -3;
     if(bind(sock, (struct sockaddr*)&client, sizeof(client)) >= 0)
         rc = StunRequest2(sock, &server, mapped);
-#ifndef _MSC_VER
+#ifndef WIN32
     close(sock);
 #else
-    _close(sock);
+    closesocket(sock);
 #endif
     return rc;
 } // StunRequest