Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add SDL2 support in sys/threads.cpp

  • Loading branch information...
commit a75387c55e0086c1b115642c9b8b2dc25b2673d2 1 parent 368bf28
@dhewg dhewg authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 neo/sys/threads.cpp
View
9 neo/sys/threads.cpp
@@ -26,6 +26,7 @@ If you have questions concerning this license or the applicable additional terms
===========================================================================
*/
+#include <SDL_version.h>
#include <SDL_mutex.h>
#include <SDL_thread.h>
#include <SDL_timer.h>
@@ -109,7 +110,11 @@ void Sys_ShutdownThreads() {
continue;
Sys_Printf("WARNING: Thread '%s' still running\n", thread[i]->name);
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ // TODO no equivalent in SDL2
+#else
SDL_KillThread(thread[i]->threadHandle);
+#endif
thread[i] = NULL;
}
@@ -218,7 +223,11 @@ Sys_CreateThread
void Sys_CreateThread(xthread_t function, void *parms, xthreadInfo& info, const char *name) {
Sys_EnterCriticalSection();
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ SDL_Thread *t = SDL_CreateThread(function, name, parms);
+#else
SDL_Thread *t = SDL_CreateThread(function, parms);
+#endif
if (!t) {
common->Error("ERROR: SDL_thread for '%s' failed\n", name);
Please sign in to comment.
Something went wrong with that request. Please try again.