Update SDL to latest main#284
Merged
Merged
Conversation
… unsafe `SDL_system.h` now contains a ```c extern SDL_DECLSPEC const char* SDLCALL SDL_GetDeviceFormFactorName(SDL_FormFactor form_factor); ``` function which gets marked with the `Unsafe_` prefix due to returning a string pointer via a ClangSharp remap. Due to the `Unsafe_` remap, `generated_symbol_regex` no longer matches methods marked `Unsafe_`. This led to `generate_platform_specific_headers()` not excluding that method, therefore emitting one extra copy of it per platform, thus causing binding compilation failures. This adds the prefix into the regex so that relevant methods can match. Of note, the `Unsafe_` prefix is placed in a *non-capturing group*, and that non-capturing group *is not inside the 2nd group* that `get_generated_symbols()` uses to retrieve the function name. This is because the output of `get_generated_symbols()` gets passed *back to ClangSharp*, which means that the *original function name* has to be retrieved for the exclusion of platform-agnostic marked-unsafe functions to actually work.
Susko3
approved these changes
Jun 22, 2026
Member
Using stable releases (or the tip of the stable branch) makes sense. We can try switching to it when SDL 3.6.0 is out (probably next year), or sooner if we feel like it. |
smoogipoo
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add unambiguous instructions how to update SDL
There were none other than a vague hint at half of it in README.
Update SDL submodule to latest
mainDoing this to include libsdl-org/SDL#15687, with the hopes of it fixing recent reports of regressing performance and/or fullscreen behaviours (ppy/osu#38121, ppy/osu#38125). I was able to reproduce the part of it to do with the system-level framerate no longer being respected, and updating to latest
maindoes appear to have fixed that issue.I will say that I think that the established practice of pointing the SDL submodule at wherever upstream
mainis at time of last person touching this repository contributes a lot to our collective chagrin related to random SDL breakage, and that we should start pointing the submodule at actual tagged stable releases. I almost did that here, but doing so resulted in some code getting removed from the generated bindings, and I did not want to explain myself further.Fix binding generator emitting duplicate symbols for functions marked unsafe
SDL_system.hnow contains afunction which gets marked with the
Unsafe_prefix due to returning a string pointer via a ClangSharp remap.generated_symbol_regexdoes not match methods markedUnsafe_. This led togenerate_platform_specific_headers()not excluding that method, therefore emitting one extra copy of it per platform, thus causing binding compilation failures.This adds the prefix into the regex so that relevant methods can match.
Of note, the
Unsafe_prefix is placed in a non-capturing group, and that non-capturing group is not inside the 2nd group thatget_generated_symbols()uses to retrieve the function name. This is because the output ofget_generated_symbols()gets passed back to ClangSharp, which means that the original function name has to be retrieved for the exclusion of platform-agnostic marked-unsafe functions to actually work.