Util: Fix C++ build for Win32

This commit is contained in:
Jeffrey Pfau 2015-02-24 00:02:24 -08:00
parent a0b94db9a7
commit 29e118b512
2 changed files with 11 additions and 2 deletions

View File

@ -12,6 +12,7 @@
extern "C" {
#include "platform/commandline.h"
#include "util/socket.h"
}
using namespace QGBA;

View File

@ -67,11 +67,19 @@ static inline bool SocketWouldBlock() {
}
static inline ssize_t SocketSend(Socket socket, const void* buffer, size_t size) {
return send(socket, buffer, size, 0);
#ifdef _WIN32
return send(socket, (const char*) buffer, size, 0);
#else
return write(socket, buffer, size);
#endif
}
static inline ssize_t SocketRecv(Socket socket, void* buffer, size_t size) {
return recv(socket, buffer, size, 0);
#ifdef _WIN32
return recv(socket, (char*) buffer, size, 0);
#else
return read(socket, buffer, size);
#endif
}
static inline Socket SocketOpenTCP(int port, const struct Address* bindAddress) {