From 7f74c1ed63ce27fcfafdfcb7a7dce7ccedb06ecf Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 18 Feb 2025 12:25:26 -0800 Subject: [PATCH 01/13] Fix SDL_emscriptenaudio.c under wasm64 Verified locally by running `browser64.test_sdl2_mixer_wav` in emscripten. (cherry picked from commit aa00738a210b207b0d7d1567b38521693d14acd6) --- src/audio/emscripten/SDL_emscriptenaudio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/audio/emscripten/SDL_emscriptenaudio.c b/src/audio/emscripten/SDL_emscriptenaudio.c index 3600fb5c587ed..304cabd0bf623 100644 --- a/src/audio/emscripten/SDL_emscriptenaudio.c +++ b/src/audio/emscripten/SDL_emscriptenaudio.c @@ -310,7 +310,7 @@ static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) if ((SDL2 === undefined) || (SDL2.capture === undefined)) { return; } audioProcessingEvent.outputBuffer.getChannelData(0).fill(0.0); SDL2.capture.currentCaptureBuffer = audioProcessingEvent.inputBuffer; - dynCall('vi', $2, [$3]); + dynCall('vp', $2, [$3]); }; SDL2.capture.mediaStreamNode.connect(SDL2.capture.scriptProcessorNode); SDL2.capture.scriptProcessorNode.connect(SDL2.audioContext.destination); @@ -326,7 +326,7 @@ static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) SDL2.capture.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { SDL2.capture.currentCaptureBuffer = SDL2.capture.silenceBuffer; - dynCall('vi', $2, [$3]); + dynCall('vp', $2, [$3]); }; SDL2.capture.silenceTimer = setInterval(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); @@ -351,7 +351,7 @@ static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) SDL2.audio.silenceBuffer = undefined; } SDL2.audio.currentOutputBuffer = e['outputBuffer']; - dynCall('vi', $2, [$3]); + dynCall('vp', $2, [$3]); }; SDL2.audio.scriptProcessorNode['connect'](SDL2.audioContext['destination']); @@ -369,7 +369,7 @@ static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) // the buffer that gets filled here just gets ignored, so the app can make progress // and/or avoid flooding audio queues until we can actually play audio. SDL2.audio.currentOutputBuffer = SDL2.audio.silenceBuffer; - dynCall('vi', $2, [$3]); + dynCall('vp', $2, [$3]); SDL2.audio.currentOutputBuffer = undefined; }; From 8b0c9e1dce7dcccea54a1c516eb2ef4712dcfed9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 19 Feb 2025 16:55:03 -0800 Subject: [PATCH 02/13] Don't leak device handle in macOS 10.10 or newer Merged upstream fix for macOS: https://github.com/libusb/hidapi/commit/cdc473dfe43f6432dda7ad53d7656b8ae8ff968b In one of the early versions of macOS, when you try to close the device with IOHIDDeviceClose() that is being physically disconnected. Starting with some version of macOS, this crash bug was fixed, and starting with macSO 10.15 the opposite effect took place: in some environments crash happens if IOHIDDeviceClose() is _not_ called. This patch is to keep a workaround for old versions of macOS, and don't have a leak in new/tested environments. Fixes https://github.com/libsdl-org/SDL/issues/12255 (cherry picked from commit 5925c27efb872be854bda4616ad5ce3e7db23927) --- src/hidapi/configure.ac | 2 +- src/hidapi/mac/Makefile-manual | 2 +- src/hidapi/mac/hid.c | 21 +++++++++++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/hidapi/configure.ac b/src/hidapi/configure.ac index c6747f906ac48..c3d3dbc1b1dbb 100644 --- a/src/hidapi/configure.ac +++ b/src/hidapi/configure.ac @@ -79,7 +79,7 @@ case $host in backend="mac" os="darwin" threads="pthreads" - LIBS="${LIBS} -framework IOKit -framework CoreFoundation" + LIBS="${LIBS} -framework IOKit -framework CoreFoundation -framework AppKit" ;; *-freebsd*) AC_MSG_RESULT([ (FreeBSD back-end)]) diff --git a/src/hidapi/mac/Makefile-manual b/src/hidapi/mac/Makefile-manual index 5399b5a70fc62..16052d143fc58 100644 --- a/src/hidapi/mac/Makefile-manual +++ b/src/hidapi/mac/Makefile-manual @@ -14,7 +14,7 @@ COBJS=hid.o CPPOBJS=../hidtest/hidtest.o OBJS=$(COBJS) $(CPPOBJS) CFLAGS+=-I../hidapi -Wall -g -c -LIBS=-framework IOKit -framework CoreFoundation +LIBS=-framework IOKit -framework CoreFoundation -framework AppKit hidtest: $(OBJS) diff --git a/src/hidapi/mac/hid.c b/src/hidapi/mac/hid.c index 0dbe4227d21c3..b45767333740b 100644 --- a/src/hidapi/mac/hid.c +++ b/src/hidapi/mac/hid.c @@ -37,6 +37,9 @@ #define VALVE_USB_VID 0x28DE +/* As defined in AppKit.h, but we don't need the entire AppKit for a single constant. */ +extern const double NSAppKitVersionNumber; + /* Barrier implementation because Mac OSX doesn't have pthread_barrier. It also doesn't have clock_gettime(). So much for POSIX and SUSv2. This implementation came from Brent Priddy and was posted on @@ -131,6 +134,7 @@ struct hid_device_list_node }; static IOHIDManagerRef hid_mgr = 0x0; +static int is_macos_10_10_or_greater = 0; static struct hid_device_list_node *device_list = 0x0; static hid_device *new_hid_device(void) @@ -485,6 +489,7 @@ static int init_hid_manager(void) int HID_API_EXPORT hid_init(void) { if (!hid_mgr) { + is_macos_10_10_or_greater = (NSAppKitVersionNumber >= 1343); /* NSAppKitVersionNumber10_10 */ return init_hid_manager(); } @@ -1138,8 +1143,10 @@ void HID_API_EXPORT hid_close(hid_device *dev) if (!dev) return; - /* Disconnect the report callback before close. */ - if (!dev->disconnected) { + /* Disconnect the report callback before close. + See comment below. + */ + if (is_macos_10_10_or_greater || !dev->disconnected) { IOHIDDeviceRegisterInputReportCallback( dev->device_handle, dev->input_report_buf, dev->max_input_report_len, NULL, dev); @@ -1162,8 +1169,14 @@ void HID_API_EXPORT hid_close(hid_device *dev) /* Close the OS handle to the device, but only if it's not been unplugged. If it's been unplugged, then calling - IOHIDDeviceClose() will crash. */ - if (!dev->disconnected) { + IOHIDDeviceClose() will crash. + + UPD: The crash part was true in/until some version of macOS. + Starting with macOS 10.15, there is an opposite effect in some environments: + crash happenes if IOHIDDeviceClose() is not called. + Not leaking a resource in all tested environments. + */ + if (is_macos_10_10_or_greater || !dev->disconnected) { IOHIDDeviceClose(dev->device_handle, kIOHIDOptionsTypeNone); } From 63bb1a85836b75f096c1cb8292501b17b7ea8d33 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 20 Feb 2025 11:50:04 +0300 Subject: [PATCH 03/13] dynapi: use DosScanEnv() for os/2. (cherry picked from commit ee49025f80e8d7bf7b2af5478bab3b0d9d739541) --- src/dynapi/SDL_dynapi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/dynapi/SDL_dynapi.c b/src/dynapi/SDL_dynapi.c index 48f50954aeefc..04adfd2ce77f4 100644 --- a/src/dynapi/SDL_dynapi.c +++ b/src/dynapi/SDL_dynapi.c @@ -440,19 +440,24 @@ extern SDL_NORETURN void SDL_ExitProcess(int exitcode); static void SDL_InitDynamicAPILocked(void) { + SDL_DYNAPI_ENTRYFN entry = NULL; /* funcs from here by default. */ + SDL_bool use_internal = SDL_TRUE; + /* this can't use SDL_getenv_REAL, because it might allocate memory before the app can set their allocator */ #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) /* We've always used LoadLibraryA for this, so this has never worked with Unicode paths on Windows. Sorry. */ char envbuf[512]; /* overflows will just report as environment variable being unset, but LoadLibraryA has a MAX_PATH of 260 anyhow, apparently. */ const DWORD rc = GetEnvironmentVariableA(SDL_DYNAMIC_API_ENVVAR, envbuf, (DWORD) sizeof (envbuf)); char *libname = ((rc != 0) && (rc < sizeof (envbuf))) ? envbuf : NULL; +#elif defined(__OS2__) + char * libname; + if (DosScanEnv(SDL_DYNAMIC_API_ENVVAR, &libname) != NO_ERROR) { + libname = NULL; + } #else char *libname = getenv(SDL_DYNAMIC_API_ENVVAR); #endif - SDL_DYNAPI_ENTRYFN entry = NULL; /* funcs from here by default. */ - SDL_bool use_internal = SDL_TRUE; - if (libname) { while (*libname && !entry) { char *ptr = libname; From 155f99a4e611ab83eeceb644df44369453fc9236 Mon Sep 17 00:00:00 2001 From: Paper Date: Mon, 17 Feb 2025 22:27:17 -0500 Subject: [PATCH 04/13] thread/windows: fix stack overflow in exception naming (cherry picked from commit 1a853973ab83ba72d22b39d871114dc22f8e3ed4) (cherry picked from commit 6421f12d7f70fa9ba68d172bc020aef8c35adccb) --- src/thread/windows/SDL_systhread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c index fbeabd5a778ca..37653f96318be 100644 --- a/src/thread/windows/SDL_systhread.c +++ b/src/thread/windows/SDL_systhread.c @@ -159,7 +159,7 @@ void SDL_SYS_SetupThread(const char *name) inf.dwFlags = 0; /* The debugger catches this, renames the thread, continues on. */ - RaiseException(0x406D1388, 0, sizeof(inf) / sizeof(ULONG), (const ULONG_PTR *)&inf); + RaiseException(0x406D1388, 0, sizeof(inf) / sizeof(ULONG_PTR), (const ULONG_PTR *)&inf); } } } From dc74448014e324c941a07bb78569411f523683fc Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 23 Feb 2025 19:40:38 +0100 Subject: [PATCH 05/13] ci: clang32 on msys2 is EOL backport of 70f657e5206317b10f33e072773e26ee54bf8073 (cherry picked from commit ed2c004c8a51d055deeb4bb6795441a95b4891ee) --- .github/workflows/create-test-plan.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/create-test-plan.py b/.github/workflows/create-test-plan.py index de18c892b3abf..3d61122d15578 100755 --- a/.github/workflows/create-test-plan.py +++ b/.github/workflows/create-test-plan.py @@ -57,7 +57,6 @@ class SdlPlatform(Enum): class Msys2Platform(Enum): Mingw32 = "mingw32" Mingw64 = "mingw64" - Clang32 = "clang32" Clang64 = "clang64" Ucrt64 = "ucrt64" @@ -107,7 +106,6 @@ class JobSpec: JOB_SPECS = { "msys2-mingw32": JobSpec(name="Windows (msys2, mingw32)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw32", msys2_platform=Msys2Platform.Mingw32, ), "msys2-mingw64": JobSpec(name="Windows (msys2, mingw64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64", msys2_platform=Msys2Platform.Mingw64, ), - "msys2-clang32": JobSpec(name="Windows (msys2, clang32)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw32-clang", msys2_platform=Msys2Platform.Clang32, ), "msys2-clang64": JobSpec(name="Windows (msys2, clang64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-clang", msys2_platform=Msys2Platform.Clang64, ), "msys2-ucrt64": JobSpec(name="Windows (msys2, ucrt64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-ucrt", msys2_platform=Msys2Platform.Ucrt64, ), "msvc-x64": JobSpec(name="Windows (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_project="VisualC/SDL.sln", ), @@ -627,7 +625,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta "clang64": "mingw-w64-clang-x86_64", "ucrt64": "mingw-w64-ucrt-x86_64", }[spec.msys2_platform.value] - job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, Msys2Platform.Clang32) + job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, ) job.shared_lib = SharedLibType.WIN32 job.static_lib = StaticLibType.A case SdlPlatform.Riscos: From a34c8403e765188b9489df27c95bacbd6ef83536 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 23 Feb 2025 19:41:48 +0100 Subject: [PATCH 06/13] ci: GitHub is retiring Ubuntu 20.04 support backport of 8d3db06ff26fde3c09d226cf518d49f1948d3ed1 (cherry picked from commit b4d733619a59db711ab3b054798192f45fc19c49) --- .github/workflows/create-test-plan.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-test-plan.py b/.github/workflows/create-test-plan.py index 3d61122d15578..22b3bb140128f 100755 --- a/.github/workflows/create-test-plan.py +++ b/.github/workflows/create-test-plan.py @@ -28,7 +28,6 @@ class JobOs(Enum): WindowsLatest = "windows-latest" UbuntuLatest = "ubuntu-latest" MacosLatest = "macos-latest" - Ubuntu20_04 = "ubuntu-20.04" Ubuntu22_04 = "ubuntu-22.04" Ubuntu24_04 = "ubuntu-24.04" Macos13 = "macos-13" @@ -118,11 +117,10 @@ class JobSpec: "msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ), "msvc-uwp-x64": JobSpec(name="UWP (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-UWP", msvc_arch=MsvcArch.X64, msvc_project="VisualC-WinRT/SDL-UWP.sln", uwp=True, ), "msvc-gdk-x64": JobSpec(name="GDK (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-GDK", msvc_arch=MsvcArch.X64, msvc_project="VisualC-GDK/SDL.sln", gdk=True, no_cmake=True, ), - "ubuntu-20.04": JobSpec(name="Ubuntu 20.04", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04", autotools=True), "ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", autotools=True), "steamrt-sniper": JobSpec(name="Steam Linux Runtime (Sniper)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-slrsniper", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:beta", ), - "ubuntu-intel-icx": JobSpec(name="Ubuntu 20.04 (Intel oneAPI)", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04-oneapi", intel=IntelCompiler.Icx, ), - "ubuntu-intel-icc": JobSpec(name="Ubuntu 20.04 (Intel Compiler)", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04-icc", intel=IntelCompiler.Icc, ), + "ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ), + "ubuntu-intel-icc": JobSpec(name="Ubuntu 22.04 (Intel Compiler)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-icc", intel=IntelCompiler.Icc, ), "macos-gnu-arm64-x64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-x64-gnu",autotools=True, apple_archs={AppleArch.X86_64, AppleArch.ARM64, }, ), "ios": JobSpec(name="iOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Ios, artifact="SDL-ios-arm64", xcode=True, ), "tvos": JobSpec(name="tvOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Tvos, artifact="SDL-tvos-arm64", xcode=True, ), From 51e20f1666a4487780b363744d56edcff12193be Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 23 Feb 2025 21:26:10 +0100 Subject: [PATCH 07/13] ci: drop classic Intel compiler 1) The classic Intel compiler is depreated in favor of the oneapi compiler 2) SPA_FALLTHROUGH is used in pipewire's spa/utils/json.h, and causes build errors (cherry picked from commit d2eb72fd14915eec952c51d9ec5be01e3abe36f3) --- .github/workflows/create-test-plan.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/create-test-plan.py b/.github/workflows/create-test-plan.py index 22b3bb140128f..8dee563a11150 100755 --- a/.github/workflows/create-test-plan.py +++ b/.github/workflows/create-test-plan.py @@ -61,7 +61,6 @@ class Msys2Platform(Enum): class IntelCompiler(Enum): - Icc = "icc" Icx = "icx" @@ -120,7 +119,6 @@ class JobSpec: "ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", autotools=True), "steamrt-sniper": JobSpec(name="Steam Linux Runtime (Sniper)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-slrsniper", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:beta", ), "ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ), - "ubuntu-intel-icc": JobSpec(name="Ubuntu 22.04 (Intel Compiler)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-icc", intel=IntelCompiler.Icc, ), "macos-gnu-arm64-x64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-x64-gnu",autotools=True, apple_archs={AppleArch.X86_64, AppleArch.ARM64, }, ), "ios": JobSpec(name="iOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Ios, artifact="SDL-ios-arm64", xcode=True, ), "tvos": JobSpec(name="tvOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Tvos, artifact="SDL-tvos-arm64", xcode=True, ), @@ -340,10 +338,6 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta case IntelCompiler.Icx: job.cc = "icx" job.cxx = "icpx" - case IntelCompiler.Icc: - job.cc = "icc" - job.cxx = "icpc" - job.cppflags.append("-diag-disable=10441") case _: raise ValueError(f"Invalid intel={spec.intel}") job.source_cmd = f"source /opt/intel/oneapi/setvars.sh;" From 9be8c2a89928d92f1847ee835ba59b8298704c7b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 23 Feb 2025 19:00:32 -0600 Subject: [PATCH 08/13] keyboard: Fix comment regarding implicit calls to SDL_StartTextInput() It was always done inside SDL_VideoInit(). (cherry picked from commit 92cadaf917b5c77d668a09aae782234b9d0c6efe) --- include/SDL_keyboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL_keyboard.h b/include/SDL_keyboard.h index 8c4efdd078658..62ac9f2288ac3 100644 --- a/include/SDL_keyboard.h +++ b/include/SDL_keyboard.h @@ -255,7 +255,7 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * On some platforms using this function activates the screen keyboard. * * On desktop platforms, SDL_StartTextInput() is implicitly called on SDL - * window creation which will cause events SDL_TextInputEvent and + * video subsystem initialization which will cause SDL_TextInputEvent and * SDL_TextEditingEvent to begin emitting. * * \since This function is available since SDL 2.0.0. From 282f7a84fceebafdf8237be4f34021d0492daa58 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Mon, 24 Feb 2025 15:03:35 +0100 Subject: [PATCH 09/13] Changed PULSEAUDIO_FlushRecording() to only flush audio present when called. When the flushing is not able to keep up with the audio stream coming in, it will end up flushing forever and block API clients from getting any audio. Fixes #9706 (cherry picked from commit 24693ac2857e614a3f3c84f8bbdca17b3423dd4c) --- src/audio/pulseaudio/SDL_pulseaudio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c index 2fb2f31c68b94..49230b7d46a4a 100644 --- a/src/audio/pulseaudio/SDL_pulseaudio.c +++ b/src/audio/pulseaudio/SDL_pulseaudio.c @@ -497,7 +497,7 @@ static void PULSEAUDIO_FlushCapture(_THIS) { struct SDL_PrivateAudioData *h = this->hidden; const void *data = NULL; - size_t nbytes = 0; + size_t nbytes = 0, buflen = 0; PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); @@ -507,19 +507,19 @@ static void PULSEAUDIO_FlushCapture(_THIS) h->capturelen = 0; } - while (SDL_AtomicGet(&this->enabled) && (PULSEAUDIO_pa_stream_readable_size(h->stream) > 0)) { + buflen = PULSEAUDIO_pa_stream_readable_size(h->stream); + while (SDL_AtomicGet(&this->enabled) && (buflen > 0)) { PULSEAUDIO_pa_threaded_mainloop_wait(pulseaudio_threaded_mainloop); if ((PULSEAUDIO_pa_context_get_state(pulseaudio_context) != PA_CONTEXT_READY) || (PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY)) { /*printf("PULSEAUDIO DEVICE FAILURE IN FLUSHCAPTURE!\n");*/ SDL_OpenedAudioDeviceDisconnected(this); break; } - - if (PULSEAUDIO_pa_stream_readable_size(h->stream) > 0) { - /* a new fragment is available! Just dump it. */ - PULSEAUDIO_pa_stream_peek(h->stream, &data, &nbytes); - PULSEAUDIO_pa_stream_drop(h->stream); /* drop this fragment. */ - } + /* a fragment of audio present before FlushCapture was call is + available! Just drop it. */ + PULSEAUDIO_pa_stream_peek(h->stream, &data, &nbytes); + PULSEAUDIO_pa_stream_drop(h->stream); + buflen -= nbytes; } PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); From 220895d4d29c4cfcde2064d9c6359107d03da184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Paku=C5=82a?= Date: Tue, 25 Feb 2025 01:02:08 +0100 Subject: [PATCH 10/13] [SDL2] Add SDL_HINT_JOYSTICK_HAPTIC_AXES Allows users to overwrite the number of haptic axes defined for a given joystick. Also supports a "wildcard" VID:PID of 0xFFFF/0xFFFF (cherry picked from commit 0809be4ec5038ed94684af149222335728c3cc43) --- include/SDL_hints.h | 21 ++++++++++ src/haptic/SDL_haptic.c | 93 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) diff --git a/include/SDL_hints.h b/include/SDL_hints.h index 4665107fd2b28..3ed72f3c04afa 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -1423,6 +1423,27 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_DEVICE "SDL_JOYSTICK_DEVICE" + +/** + * A variable containing a list of devices and their desired number of haptic + * (force feedback) enabled axis. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form plus the number of desired axes, e.g. + * + * `0xAAAA/0xBBBB/1,0xCCCC/0xDDDD/3` + * + * This hint supports a "wildcard" device that will set the number of haptic + * axes on all initialized haptic devices which were not defined explicitly + * in this hint. + * + * `0xFFFF/0xFFFF/1` + * + * This hint should be set before a controller is opened. The number of + * haptic axes won't exceed the number of real axes found on the device. +*/ +#define SDL_HINT_JOYSTICK_HAPTIC_AXES "SDL_JOYSTICK_HAPTIC_AXES" + /** * A variable controlling whether joysticks on Linux will always treat 'hat' * axis inputs (ABS_HAT0X - ABS_HAT3Y) as 8-way digital hats without checking diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index 349eb632a0fd8..86510d5085204 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -23,6 +23,85 @@ #include "SDL_syshaptic.h" #include "SDL_haptic_c.h" #include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */ +#include "SDL_hints.h" +#include "../SDL_hints_c.h" + +typedef struct SDL_Haptic_VIDPID_Naxes { + Uint16 vid; + Uint16 pid; + Uint16 naxes; +} SDL_Haptic_VIDPID_Naxes; + +static void SDL_HapticLoadAxesList(SDL_Haptic_VIDPID_Naxes **entries, int *num_entries) +{ + SDL_Haptic_VIDPID_Naxes entry; + const char *spot; + int length = 0; + + spot = SDL_GetHint(SDL_HINT_JOYSTICK_HAPTIC_AXES); + if (!spot) + return; + + while (SDL_sscanf(spot, "0x%hx/0x%hx/%hu%n", &entry.vid, &entry.pid, &entry.naxes, &length) == 3) { + SDL_assert(length > 0); + spot += length; + length = 0; + + if ((*num_entries % 8) == 0) { + int new_max = *num_entries + 8; + SDL_Haptic_VIDPID_Naxes *new_entries = + (SDL_Haptic_VIDPID_Naxes *)SDL_realloc(*entries, new_max * sizeof(**entries)); + + // Out of memory, go with what we have already + if (!new_entries) + break; + + *entries = new_entries; + } + (*entries)[(*num_entries)++] = entry; + + if (spot[0] == ',') + spot++; + } +} + +// /* Return -1 if not found */ +static int SDL_HapticNaxesListIndex(struct SDL_Haptic_VIDPID_Naxes *entries, int num_entries, Uint16 vid, Uint16 pid) +{ + int i; + if (!entries) + return -1; + + for (i = 0; i < num_entries; ++i) { + if (entries[i].vid == vid && entries[i].pid == pid) + return i; + } + + return -1; +} + +// Check if device needs a custom number of naxes +static int SDL_HapticGetNaxes(Uint16 vid, Uint16 pid) +{ + int num_entries = 0, index = 0, naxes = -1; + SDL_Haptic_VIDPID_Naxes *naxes_list = NULL; + + SDL_HapticLoadAxesList(&naxes_list, &num_entries); + if (!num_entries || !naxes_list) + return -1; + + // Perform "wildcard" pass + index = SDL_HapticNaxesListIndex(naxes_list, num_entries, 0xffff, 0xffff); + if (index >= 0) + naxes = naxes_list[index].naxes; + + index = SDL_HapticNaxesListIndex(naxes_list, num_entries, vid, pid); + if (index >= 0) + naxes = naxes_list[index].naxes; + + SDL_free(naxes_list); + return naxes; +} /* Global for SDL_windowshaptic.c */ #if defined(SDL_HAPTIC_DINPUT) || defined(SDL_HAPTIC_XINPUT) @@ -258,6 +337,8 @@ SDL_Haptic *SDL_HapticOpenFromJoystick(SDL_Joystick *joystick) { SDL_Haptic *haptic; SDL_Haptic *hapticlist; + int naxes, general_axes; + Uint16 vid, pid; /* Make sure there is room. */ if (SDL_NumHaptics() <= 0) { @@ -314,6 +395,18 @@ SDL_Haptic *SDL_HapticOpenFromJoystick(SDL_Joystick *joystick) } SDL_UnlockJoysticks(); + vid = SDL_JoystickGetVendor(joystick); + pid = SDL_JoystickGetProduct(joystick); + general_axes = SDL_JoystickNumAxes(joystick); + + naxes = SDL_HapticGetNaxes(vid, pid); + if (naxes > 0) + haptic->naxes = naxes; + + // Limit to the actual number of axes found on the device + if (general_axes >= 0 && naxes > general_axes) + haptic->naxes = general_axes; + /* Add haptic to list */ ++haptic->ref_count; /* Link the haptic in the list */ From c2047f0496e032b3a9b5a382635ad4f725b75c0d Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Tue, 25 Feb 2025 15:55:15 +0000 Subject: [PATCH 11/13] Sync SDL2 wiki -> header [ci skip] (cherry picked from commit 52ac07d327956a542f92c6f0e00f8eea17c00ed5) --- include/SDL_hints.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/SDL_hints.h b/include/SDL_hints.h index 3ed72f3c04afa..6713d01fea204 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -1434,14 +1434,14 @@ extern "C" { * `0xAAAA/0xBBBB/1,0xCCCC/0xDDDD/3` * * This hint supports a "wildcard" device that will set the number of haptic - * axes on all initialized haptic devices which were not defined explicitly - * in this hint. + * axes on all initialized haptic devices which were not defined explicitly in + * this hint. * * `0xFFFF/0xFFFF/1` * - * This hint should be set before a controller is opened. The number of - * haptic axes won't exceed the number of real axes found on the device. -*/ + * This hint should be set before a controller is opened. The number of haptic + * axes won't exceed the number of real axes found on the device. + */ #define SDL_HINT_JOYSTICK_HAPTIC_AXES "SDL_JOYSTICK_HAPTIC_AXES" /** From 024c27645a0d5d794ba2812ab355bfbe4be37103 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Feb 2025 18:49:31 -0800 Subject: [PATCH 12/13] Added support for the "%n" sscanf format specifier (cherry picked from commit 69803253100111f870c068300d336edac19783b4) (cherry picked from commit ab44451578ec6e449bd78b8f99ee0333dba69e3c) --- src/stdlib/SDL_string.c | 31 ++++++++++++++++++++++ test/testautomation_stdlib.c | 50 +++++++++++++++++++++--------------- 2 files changed, 61 insertions(+), 20 deletions(-) diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index 9af6977fe6b28..2ce22186e3c56 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -1113,6 +1113,7 @@ static SDL_bool CharacterMatchesSet(char c, const char *set, size_t set_len) /* NOLINTNEXTLINE(readability-non-const-parameter) */ int SDL_vsscanf(const char *text, const char *fmt, va_list ap) { + const char *start = text; int retval = 0; if (!text || !*text) { @@ -1383,6 +1384,36 @@ int SDL_vsscanf(const char *text, const char *fmt, va_list ap) } done = SDL_TRUE; break; + case 'n': + switch (inttype) { + case DO_SHORT: + { + short *valuep = va_arg(ap, short *); + *valuep = (short)(text - start); + } break; + case DO_INT: + { + int *valuep = va_arg(ap, int *); + *valuep = (int)(text - start); + } break; + case DO_LONG: + { + long *valuep = va_arg(ap, long *); + *valuep = (long)(text - start); + } break; + case DO_LONGLONG: + { + long long *valuep = va_arg(ap, long long *); + *valuep = (long long)(text - start); + } break; + case DO_SIZE_T: + { + size_t *valuep = va_arg(ap, size_t *); + *valuep = (size_t)(text - start); + } break; + } + done = SDL_TRUE; + break; case '[': { const char *set = fmt + 1; diff --git a/test/testautomation_stdlib.c b/test/testautomation_stdlib.c index 30abf0a7f76a3..e62069da4b1ae 100644 --- a/test/testautomation_stdlib.c +++ b/test/testautomation_stdlib.c @@ -393,6 +393,7 @@ int stdlib_getsetenv(void *arg) #endif #define FMT_PRILLd "%lld" +#define FMT_PRILLdn "%lld%lln" #define FMT_PRILLu "%llu" /** @@ -403,11 +404,12 @@ int stdlib_sscanf(void *arg) { int output; int result; + int length; int expected_output; int expected_result; - short short_output, expected_short_output; - long long_output, expected_long_output; - long long long_long_output, expected_long_long_output; + short short_output, expected_short_output, short_length; + long long_output, expected_long_output, long_length; + long long long_long_output, expected_long_long_output, long_long_length; size_t size_output, expected_size_output; char text[128], text2[128]; @@ -426,43 +428,51 @@ int stdlib_sscanf(void *arg) SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); output = 123; + length = 0; expected_output = 2; expected_result = 1; - result = SDL_sscanf("2", "%i", &output); - SDLTest_AssertPass("Call to SDL_sscanf(\"2\", \"%%i\", &output)"); + result = SDL_sscanf("2", "%i%n", &output, &length); + SDLTest_AssertPass("Call to SDL_sscanf(\"2\", \"%%i%%n\", &output, &length)"); SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + SDLTest_AssertCheck(length == 1, "Check length, expected: 1, got: %i", length); output = 123; + length = 0; expected_output = 0xa; expected_result = 1; - result = SDL_sscanf("aa", "%1x", &output); - SDLTest_AssertPass("Call to SDL_sscanf(\"aa\", \"%%1x\", &output)"); + result = SDL_sscanf("aa", "%1x%n", &output, &length); + SDLTest_AssertPass("Call to SDL_sscanf(\"aa\", \"%%1x%%n\", &output, &length)"); SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + SDLTest_AssertCheck(length == 1, "Check length, expected: 1, got: %i", length); -#define SIZED_TEST_CASE(type, var, format_specifier) \ +#define SIZED_TEST_CASE(type, var, printf_specifier, scanf_specifier) \ var##_output = 123; \ + var##_length = 0; \ expected_##var##_output = (type)(((unsigned type)(~0)) >> 1); \ expected_result = 1; \ - result = SDL_snprintf(text, sizeof(text), format_specifier, expected_##var##_output); \ - result = SDL_sscanf(text, format_specifier, &var##_output); \ - SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", \"%s\", &output)", text, #format_specifier); \ - SDLTest_AssertCheck(expected_##var##_output == var##_output, "Check output, expected: " format_specifier ", got: " format_specifier, expected_##var##_output, var##_output); \ + result = SDL_snprintf(text, sizeof(text), printf_specifier, expected_##var##_output); \ + result = SDL_sscanf(text, scanf_specifier, &var##_output, &var##_length); \ + SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", %s, &output, &length)", text, #scanf_specifier); \ + SDLTest_AssertCheck(expected_##var##_output == var##_output, "Check output, expected: " printf_specifier ", got: " printf_specifier, expected_##var##_output, var##_output); \ SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); \ + SDLTest_AssertCheck(var##_length == (type)SDL_strlen(text), "Check length, expected: %i, got: %i", (int)SDL_strlen(text), (int)var##_length); \ \ var##_output = 123; \ + var##_length = 0; \ expected_##var##_output = ~(type)(((unsigned type)(~0)) >> 1); \ expected_result = 1; \ - result = SDL_snprintf(text, sizeof(text), format_specifier, expected_##var##_output); \ - result = SDL_sscanf(text, format_specifier, &var##_output); \ - SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", \"%s\", &output)", text, #format_specifier); \ - SDLTest_AssertCheck(expected_##var##_output == var##_output, "Check output, expected: " format_specifier ", got: " format_specifier, expected_##var##_output, var##_output); \ - SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + result = SDL_snprintf(text, sizeof(text), printf_specifier, expected_##var##_output); \ + result = SDL_sscanf(text, scanf_specifier, &var##_output, &var##_length); \ + SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", %s, &output, &length)", text, #scanf_specifier); \ + SDLTest_AssertCheck(expected_##var##_output == var##_output, "Check output, expected: " printf_specifier ", got: " printf_specifier, expected_##var##_output, var##_output); \ + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); \ + SDLTest_AssertCheck(var##_length == (type)SDL_strlen(text), "Check length, expected: %i, got: %i", (int)SDL_strlen(text), (int)var##_length); \ - SIZED_TEST_CASE(short, short, "%hd") - SIZED_TEST_CASE(long, long, "%ld") - SIZED_TEST_CASE(long long, long_long, "%lld") + SIZED_TEST_CASE(short, short, "%hd", "%hd%hn") + SIZED_TEST_CASE(long, long, "%ld", "%ld%ln") + SIZED_TEST_CASE(long long, long_long, FMT_PRILLd, FMT_PRILLdn) size_output = 123; expected_size_output = ~((size_t)0); From e11183ea6caa3ae4895f4bc54cad2bbb0e365417 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 1 Mar 2025 18:00:11 -0800 Subject: [PATCH 13/13] Updated to version 2.32.2 for release --- CMakeLists.txt | 2 +- Makefile.os2 | 2 +- Makefile.w32 | 2 +- Xcode/SDL/Info-Framework.plist | 4 ++-- Xcode/SDL/SDL.xcodeproj/project.pbxproj | 12 ++++++------ Xcode/SDL/pkg-support/SDL.info | 2 +- .../src/main/java/org/libsdl/app/SDLActivity.java | 2 +- configure | 2 +- configure.ac | 2 +- include/SDL_version.h | 2 +- src/main/windows/version.rc | 8 ++++---- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 30ff00adf9387..8baa8a50ebe53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,7 @@ endif() # See docs/release_checklist.md set(SDL_MAJOR_VERSION 2) set(SDL_MINOR_VERSION 32) -set(SDL_MICRO_VERSION 0) +set(SDL_MICRO_VERSION 2) set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") # Set defaults preventing destination file conflicts diff --git a/Makefile.os2 b/Makefile.os2 index f35395ab20a79..d0fde2f363107 100644 --- a/Makefile.os2 +++ b/Makefile.os2 @@ -15,7 +15,7 @@ LIBNAME = SDL2 MAJOR_VERSION = 2 MINOR_VERSION = 32 -MICRO_VERSION = 0 +MICRO_VERSION = 2 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) DESCRIPTION = Simple DirectMedia Layer 2 diff --git a/Makefile.w32 b/Makefile.w32 index 40ff9cca97a60..59f8061436f17 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -6,7 +6,7 @@ LIBNAME = SDL2 MAJOR_VERSION = 2 MINOR_VERSION = 32 -MICRO_VERSION = 0 +MICRO_VERSION = 2 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) LIBHOME = . diff --git a/Xcode/SDL/Info-Framework.plist b/Xcode/SDL/Info-Framework.plist index 42092c3b781bf..6c6dff596a542 100644 --- a/Xcode/SDL/Info-Framework.plist +++ b/Xcode/SDL/Info-Framework.plist @@ -19,10 +19,10 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.32.0 + 2.32.2 CFBundleSignature SDLX CFBundleVersion - 2.32.0 + 2.32.2 diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 80949aefbb284..30caa03bb689f 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -9729,7 +9729,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEPLOYMENT_POSTPROCESSING = YES; DYLIB_COMPATIBILITY_VERSION = 3201.0.0; - DYLIB_CURRENT_VERSION = 3201.0.0; + DYLIB_CURRENT_VERSION = 3201.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_ALTIVEC_EXTENSIONS = YES; @@ -9770,7 +9770,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_LINK_OBJC_RUNTIME = NO; - MARKETING_VERSION = 2.32.0; + MARKETING_VERSION = 2.32.2; OTHER_LDFLAGS = "-liconv"; }; name = Release; @@ -9814,7 +9814,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 3201.0.0; - DYLIB_CURRENT_VERSION = 3201.0.0; + DYLIB_CURRENT_VERSION = 3201.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -9856,7 +9856,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_LINK_OBJC_RUNTIME = NO; - MARKETING_VERSION = 2.32.0; + MARKETING_VERSION = 2.32.2; OTHER_LDFLAGS = "-liconv"; }; name = Debug; @@ -10063,7 +10063,7 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 3201.0.0; - DYLIB_CURRENT_VERSION = 3201.0.0; + DYLIB_CURRENT_VERSION = 3201.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; @@ -10115,7 +10115,7 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 3201.0.0; - DYLIB_CURRENT_VERSION = 3201.0.0; + DYLIB_CURRENT_VERSION = 3201.2.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; diff --git a/Xcode/SDL/pkg-support/SDL.info b/Xcode/SDL/pkg-support/SDL.info index c1a66f7b388ee..fedf62caa5974 100644 --- a/Xcode/SDL/pkg-support/SDL.info +++ b/Xcode/SDL/pkg-support/SDL.info @@ -1,4 +1,4 @@ -Title SDL 2.32.0 +Title SDL 2.32.2 Version 1 Description SDL Library for Mac OS X (http://www.libsdl.org) DefaultLocation /Library/Frameworks diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index 27ecad87dfabb..c1c4c661f3621 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh private static final String TAG = "SDL"; private static final int SDL_MAJOR_VERSION = 2; private static final int SDL_MINOR_VERSION = 32; - private static final int SDL_MICRO_VERSION = 0; + private static final int SDL_MICRO_VERSION = 2; /* // Display InputType.SOURCE/CLASS of events and devices // diff --git a/configure b/configure index 5b9dbeed6e23c..bcfeead98911c 100755 --- a/configure +++ b/configure @@ -3516,7 +3516,7 @@ orig_CFLAGS="$CFLAGS" # See docs/release_checklist.md SDL_MAJOR_VERSION=2 SDL_MINOR_VERSION=32 -SDL_MICRO_VERSION=0 +SDL_MICRO_VERSION=2 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION` diff --git a/configure.ac b/configure.ac index 1f7e8dc2d092a..146d56f93e237 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ dnl Set various version strings - taken gratefully from the GTk sources # See docs/release_checklist.md SDL_MAJOR_VERSION=2 SDL_MINOR_VERSION=32 -SDL_MICRO_VERSION=0 +SDL_MICRO_VERSION=2 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION` diff --git a/include/SDL_version.h b/include/SDL_version.h index 32d1133beea13..0465020776924 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -58,7 +58,7 @@ typedef struct SDL_version */ #define SDL_MAJOR_VERSION 2 #define SDL_MINOR_VERSION 32 -#define SDL_PATCHLEVEL 0 +#define SDL_PATCHLEVEL 2 /** * Macro to determine SDL version program was compiled against. diff --git a/src/main/windows/version.rc b/src/main/windows/version.rc index 42ba606fe4d72..28a6a0669114b 100644 --- a/src/main/windows/version.rc +++ b/src/main/windows/version.rc @@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,32,0,0 - PRODUCTVERSION 2,32,0,0 + FILEVERSION 2,32,2,0 + PRODUCTVERSION 2,32,2,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x40004L @@ -23,12 +23,12 @@ BEGIN BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "SDL\0" - VALUE "FileVersion", "2, 32, 0, 0\0" + VALUE "FileVersion", "2, 32, 2, 0\0" VALUE "InternalName", "SDL\0" VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0" VALUE "OriginalFilename", "SDL2.dll\0" VALUE "ProductName", "Simple DirectMedia Layer\0" - VALUE "ProductVersion", "2, 32, 0, 0\0" + VALUE "ProductVersion", "2, 32, 2, 0\0" END END BLOCK "VarFileInfo"