Util: Fix C++ build for Win32
Jeffrey Pfau jeffrey@endrift.com
Tue, 24 Feb 2015 00:02:24 -0800
2 files changed,
11 insertions(+),
2 deletions(-)
M
src/platform/qt/GBAApp.cpp
→
src/platform/qt/GBAApp.cpp
@@ -12,6 +12,7 @@ #include <QFileOpenEvent>
extern "C" { #include "platform/commandline.h" +#include "util/socket.h" } using namespace QGBA;
M
src/util/socket.h
→
src/util/socket.h
@@ -67,11 +67,19 @@ #endif
} 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) {