Add fallback for the restrict keyword being unavailable to bind_gen #441
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.
Pretty much every compiler already supports
restrict
when compiling C, but for the ones that don't, this should improve compatibility. Additionally, using the generatedlivesplit_core.h
in a CMake project with a minimal target feature requirement setting (c_restrict
) causes IDE syntax highlighting errors when Visual Studio is used as the generator, because it lacks ac99
option. This ends up fixed too.I didn't add a generic fallback (
#define restrict
) as I doubt there's a standard way to query compiler extensions like that, especially not at gen-time, and a lot of things support__restrict
. I can make it overridable for odd toolchains, if you'd like:There theoretically could be issues with other language bindings if they're generated from
livesplit_core.h
, though I imagine that's unlikely, ascargo run
inbind_gen
seems to generate all of the languages, and I encounted no errors during that. This PR should also have identical semantics for most compilers (everything but C in a mode earlier than C99 should be the same).P.S. I haven't made many PRs so I hope this is up to standard!