GDExtension: Clean up types for new classdb_register_extension_class6#118750
Merged
Repiteo merged 1 commit intoApr 20, 2026
Merged
Conversation
Ivorforce
approved these changes
Apr 19, 2026
Contributor
|
Thanks! |
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.
This is a follow-up to #118214 (a new feature for Godot 4.7 by @Ivorforce), in order to make it more consistent with how we've handled these changes in the past
The main change is making
GDExtensionClassCreationInfo6into a "struct" rather than an "alias" forGDExtensionClassCreationInfo5so that it can explicitly take theGDExtensionClassCreateInstance3typeAt a binary level this is equivalent to what was added in #118214, however, I think the important distinction here is the semantic difference between
GDExtensionClassCreateInstance2andGDExtensionClassCreateInstance3, and so I'd prefer if it were documented in those terms, rather than just a note onclassdb_register_extension_class6. This allows us to document the latest thing, rather than using a reference to the previous thing. I think this will be more "evergreen" as we continue to iterate and inevitably make new versions of this interface function and structThis ends up having some follow on effects and I also did some small clean-up too:
create_instance_funcwasn't great, so updated it onGDExtensionClassCreationInfo6which is added in this PR, but then for consistency, I copied it to the older structsClassCreationDeprecatedInfonow takes the function pointer rather than a boolean flag (and everything is non-legacy when all fields on this struct are zero)GDExtension::_register_extension_class_internal()now takes aGDExtensionClassCreationInfo6and all the deprecated functions work in terms of that struct nowGiven that this is a new Godot 4.7 feature, and we don't want to change the
gdextension_interface.jsonin patch releases, I think this qualifies for merge after the feature freeze :-)