Skip to content

Commit 5874423

Browse files
committed
ogc use pthreads
1 parent 677a1de commit 5874423

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,13 +2915,6 @@ elseif(OGC)
29152915
set(HAVE_SDL_JOYSTICK TRUE)
29162916
endif()
29172917

2918-
if(SDL_THREADS)
2919-
set(SDL_THREAD_OGC 1)
2920-
file(GLOB OGC_THREAD_SOURCES ${SDL2_SOURCE_DIR}/src/thread/ogc/*.c)
2921-
list(APPEND SOURCE_FILES ${OGC_THREAD_SOURCES} ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c)
2922-
set(HAVE_SDL_THREADS TRUE)
2923-
endif()
2924-
29252918
if(SDL_TIMERS)
29262919
set(SDL_TIMER_OGC 1)
29272920
file(GLOB OGC_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/ogc/*.c)
@@ -2945,6 +2938,12 @@ elseif(OGC)
29452938
endif()
29462939
endif()
29472940

2941+
set(SDL_PTHREADS ON)
2942+
set(SDL_THREADS ON)
2943+
set(PTHREADS_SEM ON)
2944+
message(STATUS "pthread")
2945+
CheckPTHREAD()
2946+
29482947
if(NOT SDL2_DISABLE_SDL2MAIN)
29492948
list(INSERT SDL_LIBS 0 "-lSDL2main")
29502949
list(APPEND EXTRA_LIBS "fat")

src/thread/pthread/SDL_systhread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void SDL_SYS_SetupThread(const char *name)
162162
}
163163

164164
/* NativeClient does not yet support signals.*/
165-
#if !defined(__NACL__)
165+
#if !defined(__NACL__) && !defined(__wii__) && !defined(__gamecube__)
166166
/* Mask asynchronous signals for this thread */
167167
sigemptyset(&mask);
168168
for (i = 0; sig_list[i]; ++i) {
@@ -188,7 +188,7 @@ SDL_threadID SDL_ThreadID(void)
188188

189189
int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
190190
{
191-
#if __NACL__ || __RISCOS__ || __OS2__
191+
#if __NACL__ || __RISCOS__ || __OS2__ || __wii__ || __gamecube__
192192
/* FIXME: Setting thread priority does not seem to be supported in NACL */
193193
return 0;
194194
#else

0 commit comments

Comments
 (0)