Skip to content

Commit c0227c0

Browse files
authored
Merge pull request #1001 from Spartan322/4.3-add/gdext-godot-compat
[4.3] Add godot compatibility header to GDExtension API dump
2 parents c7d5fb7 + 96e7bce commit c0227c0

1 file changed

Lines changed: 27 additions & 10 deletions

File tree

core/extension/extension_api_dump.cpp

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,38 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
104104
Dictionary api_dump;
105105

106106
{
107-
//header
108-
Dictionary header;
109-
header["version_major"] = VERSION_MAJOR;
110-
header["version_minor"] = VERSION_MINOR;
107+
//redot header
108+
Dictionary redot_header;
109+
redot_header["version_major"] = VERSION_MAJOR;
110+
redot_header["version_minor"] = VERSION_MINOR;
111111
#if VERSION_PATCH
112-
header["version_patch"] = VERSION_PATCH;
112+
redot_header["version_patch"] = VERSION_PATCH;
113113
#else
114114
header["version_patch"] = 0;
115115
#endif
116-
header["version_status"] = VERSION_STATUS;
117-
header["version_status_version"] = VERSION_STATUS_VERSION;
118-
header["version_build"] = VERSION_BUILD;
119-
header["version_full_name"] = VERSION_FULL_NAME;
116+
redot_header["version_status"] = VERSION_STATUS;
117+
redot_header["version_status_version"] = VERSION_STATUS_VERSION;
118+
redot_header["version_build"] = VERSION_BUILD;
119+
redot_header["version_full_name"] = VERSION_FULL_NAME;
120120

121-
api_dump["header"] = header;
121+
api_dump["redot_header"] = redot_header;
122+
}
123+
124+
{
125+
//godot compatible header
126+
Dictionary godot_compat_header;
127+
godot_compat_header["version_major"] = GODOT_VERSION_MAJOR;
128+
godot_compat_header["version_minor"] = GODOT_VERSION_MINOR;
129+
#if GODOT_VERSION_PATCH
130+
godot_compat_header["version_patch"] = GODOT_VERSION_PATCH;
131+
#else
132+
godot_compat_header["version_patch"] = 0;
133+
#endif
134+
godot_compat_header["version_status"] = GODOT_VERSION_STATUS;
135+
godot_compat_header["version_build"] = GODOT_VERSION_BUILD;
136+
godot_compat_header["version_full_name"] = GODOT_VERSION_FULL_NAME;
137+
138+
api_dump["header"] = godot_compat_header;
122139
}
123140

124141
const uint32_t vec3_elems = 3;

0 commit comments

Comments
 (0)