Skip to content

Commit b720cbc

Browse files
committed
Merge pull request #107963 from bruvzg/sdl_nx_fix
Fix SDL threading on macOS/Linux.
2 parents 0564019 + 71dd7b5 commit b720cbc

File tree

4 files changed

+9
-63
lines changed

4 files changed

+9
-63
lines changed

drivers/sdl/SCsub

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ if env["builtin_sdl"]:
9090
"stdlib/SDL_string.c",
9191
"stdlib/SDL_strtokr.c",
9292
"thread/SDL_thread.c",
93-
"thread/generic/SDL_syscond.c",
94-
"thread/generic/SDL_sysrwlock.c",
95-
"thread/generic/SDL_systhread.c",
9693
"timer/SDL_timer.c",
9794
]
9895

@@ -182,6 +179,8 @@ if env["builtin_sdl"]:
182179
"joystick/windows/SDL_windows_gaming_input.c",
183180
"joystick/windows/SDL_windowsjoystick.c",
184181
"joystick/windows/SDL_xinputjoystick.c",
182+
"thread/generic/SDL_syscond.c",
183+
"thread/generic/SDL_sysrwlock.c",
185184
"thread/windows/SDL_syscond_cv.c",
186185
"thread/windows/SDL_sysmutex.c",
187186
"thread/windows/SDL_sysrwlock_srw.c",

platform/linuxbsd/detect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def configure(env: "SConsEnvironment"):
397397
if env["sdl"]:
398398
if env["builtin_sdl"]:
399399
env.Append(CPPDEFINES=["SDL_ENABLED"])
400-
elif os.system("pkg-config --exists fontconfig") == 0: # 0 means found
400+
elif os.system("pkg-config --exists sdl3") == 0: # 0 means found
401401
env.ParseConfig("pkg-config sdl3 --cflags --libs")
402402
env.Append(CPPDEFINES=["SDL_ENABLED"])
403403
else:

thirdparty/sdl/thread/generic/SDL_systhread.c

Lines changed: 0 additions & 57 deletions
This file was deleted.

thirdparty/sdl/update-sdl.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ mkdir $target/sensor
6363
cp -rv sensor/{*.{c,h},dummy} $target/sensor
6464

6565
mkdir $target/thread
66-
cp -rv thread/{*.{c,h},generic,pthread,windows} $target/thread
67-
rm -f $target/thread/generic/SDL_{sysmutex*.{c,h},systls.c}
66+
cp -rv thread/{*.{c,h},pthread,windows} $target/thread
67+
# Despite being 'generic', syssem.c is included in the Unix driver for macOS,
68+
# and syscond/sysrwlock are used by the Windows driver.
69+
# systhread_c.h is included by all these, but we should NOT compile the matching .c file.
70+
mkdir $target/thread/generic
71+
cp -v thread/generic/SDL_{syssem.c,{syscond,sysrwlock}*.{c,h},systhread_c.h} $target/thread/generic
6872

6973
mkdir $target/timer
7074
cp -rv timer/{*.{c,h},unix,windows} $target/timer

0 commit comments

Comments
 (0)