From ec1beaa2ee07368368e9bd45fe400eedc57419eb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 21 Aug 2013 14:37:03 +0300 Subject: first part of fixes for compilation with SDL2 --- src/net/download.cpp | 4 ++++ src/net/ea/network.cpp | 4 ++++ src/net/sdltcpnet.cpp | 2 +- src/net/sdltcpnet.h | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/net/download.cpp b/src/net/download.cpp index a8f0e1c0c..f469a3258 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -169,7 +169,11 @@ bool Download::start() { logger->log("Starting download: %s", mUrl.c_str()); +#ifdef USE_SDL2 + mThread = SDL_CreateThread(downloadThread, "download", this); +#else mThread = SDL_CreateThread(downloadThread, this); +#endif if (!mThread) { diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp index 5214cf7e4..3bcda3db3 100644 --- a/src/net/ea/network.cpp +++ b/src/net/ea/network.cpp @@ -114,7 +114,11 @@ bool Network::connect(ServerInfo server) mToSkip = 0; mState = CONNECTING; +#ifdef USE_SDL2 + mWorkerThread = SDL_CreateThread(networkThread, "network", this); +#else mWorkerThread = SDL_CreateThread(networkThread, this); +#endif if (!mWorkerThread) { setError("Unable to create network worker thread"); diff --git a/src/net/sdltcpnet.cpp b/src/net/sdltcpnet.cpp index 7b0d2700f..cb6d6145e 100644 --- a/src/net/sdltcpnet.cpp +++ b/src/net/sdltcpnet.cpp @@ -75,7 +75,7 @@ int TcpNet::send(const TcpNet::Socket sock, const void *const data, return SDLNet_TCP_Send(sock, data, len); } -char *TcpNet::getError() +const char *TcpNet::getError() { return SDLNet_GetError(); } diff --git a/src/net/sdltcpnet.h b/src/net/sdltcpnet.h index 1d83b04fc..e8772b4bd 100644 --- a/src/net/sdltcpnet.h +++ b/src/net/sdltcpnet.h @@ -40,7 +40,7 @@ namespace TcpNet int send(const TcpNet::Socket sock, const void *const data, const int len); - char *getError(); + const char *getError(); int resolveHost(IPaddress *const address, const char *const host, const Uint16 port); -- cgit v1.2.3-70-g09d2