all repos — mgba @ 29e118b512ed5b0b5bb3df86c432139687f477ca

mGBA Game Boy Advance Emulator

Util: Fix C++ build for Win32
Jeffrey Pfau jeffrey@endrift.com
Tue, 24 Feb 2015 00:02:24 -0800
commit

29e118b512ed5b0b5bb3df86c432139687f477ca

parent

a0b94db9a78a6482579edd35e6eefeb4b15bb257

2 files changed, 11 insertions(+), 2 deletions(-)

jump to
M src/platform/qt/GBAApp.cppsrc/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.hsrc/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) {