aboutsummaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-04-08 12:55:06 -0400
committerkwolekr <kwolekr@minetest.net>2015-04-08 12:56:53 -0400
commitc758fd73ff0b95ca27f833f8aefd0345edd71fcc (patch)
tree513acce782932ed7eb1e57bbf0cf81b45c400d7b /src/socket.cpp
parentd2fc98e4a689288a04d07da49b673f39ffabf64b (diff)
downloadminetest-c758fd73ff0b95ca27f833f8aefd0345edd71fcc.tar.gz
minetest-c758fd73ff0b95ca27f833f8aefd0345edd71fcc.tar.bz2
minetest-c758fd73ff0b95ca27f833f8aefd0345edd71fcc.zip
Link against shlwapi.lib and unify linker input sources for Windows
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index c3b5fc564..e82052f77 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -44,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
@@ -154,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;
@@ -168,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)
@@ -514,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++) {
@@ -525,7 +522,7 @@ int UDPSocket::Receive(Address & sender, void *data, int size)
}
if(received > 20)
dstream << "...";
-
+
dstream << std::endl;
}
@@ -586,7 +583,7 @@ bool UDPSocket::WaitData(int timeout_ms)
// No data
return false;
}
-
+
// There is data
return true;
}