]> git.lizzy.rs Git - minetest.git/blobdiff - src/socket.cpp
Rollback: Fail on bad precondition instead of causing assertion error
[minetest.git] / src / socket.cpp
index df9c57c5f9223a06d511e83e2b2e1551ebd706dd..e82052f7728083430f32e3ed2bdd2d914045dc99 100644 (file)
@@ -32,7 +32,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "debug.h"
 #include "settings.h"
 #include "log.h"
-#include "main.h" // for g_settings
 
 #ifdef _WIN32
        #ifndef WIN32_LEAN_AND_MEAN
@@ -45,9 +44,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
        #include <windows.h>
        #include <winsock2.h>
        #include <ws2tcpip.h>
-       #ifdef _MSC_VER
-               #pragma comment(lib, "ws2_32.lib")
-       #endif
 typedef SOCKET socket_t;
 typedef int socklen_t;
 #else
@@ -155,7 +151,7 @@ void Address::Resolve(const char *name)
 
        struct addrinfo *resolved, hints;
        memset(&hints, 0, sizeof(hints));
-       
+
        // Setup hints
        hints.ai_socktype = 0;
        hints.ai_protocol = 0;
@@ -169,7 +165,7 @@ void Address::Resolve(const char *name)
        {
                hints.ai_family = AF_INET;
        }
-       
+
        // Do getaddrinfo()
        int e = getaddrinfo(name, NULL, &hints, &resolved);
        if(e != 0)
@@ -515,7 +511,7 @@ int UDPSocket::Receive(Address & sender, void *data, int size)
                dstream << (int) m_handle << " <- ";
                sender.print(&dstream);
                dstream << ", size=" << received;
-               
+
                // Print packet contents
                dstream << ", data=";
                for(int i = 0; i < received && i < 20; i++) {
@@ -526,7 +522,7 @@ int UDPSocket::Receive(Address & sender, void *data, int size)
                }
                if(received > 20)
                        dstream << "...";
-               
+
                dstream << std::endl;
        }
 
@@ -587,7 +583,7 @@ bool UDPSocket::WaitData(int timeout_ms)
                // No data
                return false;
        }
-       
+
        // There is data
        return true;
 }