Commit Graph

12538 Commits

Author SHA1 Message Date
Cameron Gutman 3ebdcc5b1c atomic: Fix and cleanup SDL_UnlockSpinlock()
- Add missing SDL_MemoryBarrierRelease() in the generic codepath
- Remove Watcom and MSVC x86/x64 cases which are now identical to the generic codepath
- Fix Solaris barrier to ensure prior stores are visible before unlocking
2026-04-27 19:50:19 -05:00
Cameron Gutman dd1e04eedf atomic: Use __atomic_signal_fence() for SDL_CompilerBarrier()
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This is the (slightly) more standard way to accomplish it.
2026-04-26 22:07:57 -05:00
Cameron Gutman 26616cd653 atomic: Fix memory barriers on MSVC ARM32/ARM64
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-04-24 20:22:25 -05:00
Cameron Gutman 15275898f0 atomic: Use acquire/release InterlockedExchange intrinsics on ARM64EC 2026-04-24 19:07:17 -05:00
Cameron Gutman 157ca95985 Fix UWP build 2026-04-24 18:54:30 -05:00
Cameron Gutman 7751494160 atomic: Use DMB ISHLD for aarch64 acquire barrier
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This is a little more efficient than a DMB ISH and matches what
GCC, Clang, and MSVC generate for a C++11 acquire fence.
2026-04-23 21:18:05 -05:00
Cameron Gutman c3b0e62850 atomic: Use __atomic_thread_fence() when available
This avoids requiring inline assembly for each architecture.

It also fixes some weakly ordered architectures which lacked
said inline assembly (RISC-V, MIPS, LoongArch, etc) and were
thus disasterously broken.
2026-04-23 18:59:40 -05:00
atirado.net c8ebb1456e Backport VIRPIL Controls device IDs to SDL2
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Backport of SDL3 fix (libsdl-org/SDL#15418).

VIRPIL Controls (VID 0x3344) flight sticks are
misclassified as gamepads by SDL's axis-count
heuristic because they report exactly 6 axes,
matching SDL_GAMEPAD_AXIS_COUNT. Adding them to
the appropriate device lists ensures correct
classification.

Tested on Linux (Fedora 43, kernel 6.19) with:
- R-VPC Stick MT-50CM3 (PID 0x4391)
- L-VPC Stick MT-50CM3 (PID 0x8390)
- VPC VMAX Prime Throttle (PID 0x0196)
2026-04-21 05:24:27 -10:00
Cameron Gutman 30de669b32 atomic: Fix missing full memory barrier on GCC/Clang
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
__sync_lock_test_and_set() is designed for creating locks, not as
a general atomic exchange function. As a result, it only provides
an acquire memory barrier and isn't guaranteed to actually store
the provided value (though it does on architectures we care about).

__atomic_exchange_n() is supported on GCC/Clang for the last ~10
years, so let's use that instead if available. We will keep the
__sync_lock_test_and_set() fallback around for ancient platforms,
but add a full memory barrier to match the documented behavior.
2026-04-20 06:17:49 -04:00
Ryan C. Gordon 2d28ee6eb7 CLAUDE.md: Just copy the text from AGENTS.md in here for now.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Someone mentioned that Claude sees this file's previous text and adds "look at
AGENTS.md" to it's TODO list instead of treating it as the thing it should do
first.

If everything decides to prefer AGENTS.md at some point, we'll delete this
file.

A symlink would apparently also work, but it would be the only symlink in the
SDL git repo, so it seemed less disruptive to just copy the file over for now.

(cherry picked from commit 847fc72b1b)
2026-04-16 13:55:59 -04:00
Ryan C. Gordon 5a9caa7432 CLAUDE.md: added.
Apparently Claude Code won't read AGENTS.md by default at this moment, but
since that's the direction we're moving, let's just add the file Claude
currently looks for and tell it that the actual instructions are in AGENTS.md.

I thought these things were supposed to be less complicated that interacting
with humans, lol.

(cherry picked from commit 1124e44e4c)
2026-04-16 12:23:03 -04:00
Ryan C. Gordon 9cab8fb595 AGENTS.md: Change "may not" to "must not".
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(Hat tip to Sean Barrett on the stronger wording here.)

(cherry picked from commit 5bda0ccfb0)
2026-04-15 17:27:57 -04:00
Ryan C. Gordon de3b6143c5 policy: Clarify that "AI" means specific things.
(cherry picked from commit 954e2f3354)
2026-04-15 15:42:38 -04:00
Ryan C. Gordon e9603fe4f9 policy: Updated AI-related text based on excellent feedback.
(cherry picked from commit 4711119605)
2026-04-15 15:42:35 -04:00
Ryan C. Gordon 4e9c6ec24c policy: Added to the PR template, and an AGENTS.md, refusing AI contributions.
Fixes #15350.

(cherry picked from commit 08285d828e)
2026-04-15 15:42:30 -04:00
Cameron Gutman 725db83c23 atomic: Use __atomic_load_n on Android 2026-04-14 18:13:15 -05:00
Cameron Gutman cf5f7965df atomic: Switch to _SDL_HAS_BUILTIN to detect __atomic_load_n 2026-04-14 18:13:15 -05:00
MAJigsaw77 6587c12e17 Use singleTop launchMode for SDLActivity on Android
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-04-13 09:28:58 +02:00
Cameron Gutman 9cc2f248f5 kmsdrm: Fix order of GBM and EGL teardown
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
All locked front buffers must be released prior to destroying
the EGL surface to avoid causing a UAF in libnvidia-egl-gbm.so.
2026-04-10 19:26:43 -05:00
Craig Chandler 88017f5023 Android: use RECEIVER_NOT_EXPORTED for receivers on API 33+
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-04-06 23:13:02 -07:00
Sam Lantinga dd01e096e9 Added a hint "SDL_SURFACE_MALLOC" to disable aligned surface allocation
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This is needed for sdl12-compat, where all surfaces were not aligned.
2026-04-02 10:36:56 -07:00
Regan Green f9e82031f4 Limit DirectSound maximum sample rate
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-25 23:11:28 -04:00
Anonymous Maarten 3debb9e2bb cmake: bump CMake policy compatibilty version 2026-03-25 19:06:10 +01:00
Anonymous Maarten 70584e55a1 ci: clang-tidy is not used 2026-03-25 18:59:26 +01:00
Ozkan Sezer 738b1e4f47 cmake: add OS2 to OPT_DEF_LIBC enable list.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-20 07:32:50 +03:00
Ozkan Sezer e107aece34 libtool.m4: remove old_archive_from_new_cmds on os2
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Fixes the static library and 'make install' issues.
From https://github.com/komh/libtool-os2
2026-03-19 10:55:20 +03:00
Ozkan Sezer e0307aa05e apply issue/#13952 fix to SDL_cpuinfo.h, too.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-17 17:01:10 +03:00
Ozkan Sezer a7d4b1996f minor os/2 emx build fix.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-17 05:02:50 +03:00
Ozkan Sezer 1e1e982ae7 libtool.m4: Use echo in archive_cmds and archive_expsym_cmds on OS/2
Fixes that building DLLs fails because $ECHO does not work when it's
set to "printf %s\n".
From https://github.com/komh/libtool-os2
2026-03-17 04:55:00 +03:00
Ozkan Sezer e7e24a1ee5 SDL_dynapi.c, os/2: remove unnecessary include. 2026-03-17 00:20:20 +03:00
Ozkan Sezer 3c28e8ecc0 add new SDL_hidapi_8bitdo.c source to Xcode project
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-15 02:40:14 +03:00
Kushagra Shukla 650aceb609 Backport 8BitDo HIDAPI Driver to SDL2 (#15207) 2026-03-14 15:20:29 -07:00
Tobiasz Laskowski 22a6d76f22 Backport android api 30+ fix for backspace to SDL2
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-03-03 22:50:31 -08:00
hexnet1234 99ecc409cf Fix Wayland_DestroyWindow SEGFAULT
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Check if the wind pointer is NULL, to avoid SEGFAULT.
Already implemented in SDL3, but not yet backported.
2026-02-20 13:04:11 -05:00
Alexandre Derumier cf5dabd6ea Correct the sensor axis ordering with the Linux Nintendo driver
Fixes https://github.com/libsdl-org/SDL/issues/14552

Manual cherry-pick of 5e9163592f by Sam Lantinga <slouken@libsdl.org>
2026-02-12 11:32:59 -08:00
Wohlstand c080cc8068 SDL_render_psp.c: Also apply the similar fix to PSP
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Since this problem is the same here
2026-02-06 09:01:33 -08:00
Wohlstand 2956d55797 SDL_render_vita_gxm.c: Fixed the black screen due to zero cliprect
#14645
2026-02-06 09:01:33 -08:00
Ozkan Sezer b1d95b9d20 SDL_cocoawindow.m: fix what seems to be a typo in commit 649c36c5:
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
NSWindowCollectionBehaviorNone -> NSWindowCollectionBehaviorFullScreenNone
2026-02-06 06:04:40 +03:00
Ryan C. Gordon 649c36c576 cocoa: Fix SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES=0.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
This hint is documented to not just turn off fullscreen windows going into a
new Fullscreen Space, but also to make the green button on a resizeable
window's title bar do a maximize/zoom instead of make the window fullscreen.

Previously, this only did the former and not the latter (or perhaps it worked
and the defaults changed in a newer macOS, we aren't sure).

Fixes #7470.

(cherry picked from commit 50f3adec77)
2026-02-05 18:53:41 -05:00
Henrique Jorge Barateli 99eca2ca0d Fixed PS2 joystick analog sticks not enabled
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-01-30 12:18:31 -08:00
Ozkan Sezer 07274fea58 SDL_bsdjoystick: fix OpenBSD build error due to -Wundef
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-01-30 01:20:28 +03:00
Brad Smith 0c7042477a cmake: Fix header detection with CheckUSBHID
Make use of check_include_files to be able to also include
stdint.h when checking for the headers. Fixes detection of
usbhid.h on OpenBSD.

/usr/include/usbhid.h:40:2: error: unknown type name 'uint32_t'
   40 |         uint32_t _usage_page;
      |         ^

(cherry picked from commit 410a35fbee)
2026-01-28 07:45:11 -08:00
Wolf3s f383330cfa Fix the video size matching the renderer.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-01-19 10:10:53 -08:00
Brad Smith de41387c4b autotools: Replace sys/types.h usage with stdint.h with CheckUSBHID
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-01-18 18:33:01 -08:00
yuanhecai 01dff47fd7 loongarch: Apply mlsx flags only to relevant source files
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-01-15 10:12:00 -05:00
Ryan C. Gordon cb0fb8c1a1 haiku: Minor code convention cleanups.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Reference PR #14779.
2026-01-07 14:06:48 -05:00
erysdren 1dda484085 haiku: update modelist logic 2026-01-07 14:00:54 -05:00
erysdren e14514f484 haiku: fix modelist double-free 2026-01-07 14:00:54 -05:00
Sam Lantinga f432937f9c Updated copyright for 2026
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-01-01 09:51:07 -08:00
Simon McVittie c795b08567 test: Don't expect a specific error message
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
SDL3 + sdl2-compat doesn't give precisely the same error message as
"classic" SDL2 here. To facilitate the transition from "classic" SDL2
to sdl2-compat, allow either one. This allows the "classic" SDL2 test
suite to be run against sdl2-compat, demonstrating that sdl2-compat is
indeed compatible with the version that it's replacing.

Signed-off-by: Simon McVittie <smcv@debian.org>
2025-12-29 10:05:15 -08:00