Skip to content

Commit 5ad22fc

Browse files
committed
Add godot compatibility header to GDExtension API dump
To retain Godot GDExtension compatibility, relies on Godot's `header`, Redot's GDExtension header is in `redot_header` (cherry picked from commit 96e7bce)
1 parent 3f44d08 commit 5ad22fc

1 file changed

Lines changed: 36 additions & 13 deletions

File tree

core/extension/extension_api_dump.cpp

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,27 +106,50 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
106106
Dictionary api_dump;
107107

108108
{
109-
//header
110-
Dictionary header;
111-
header["version_major"] = REDOT_VERSION_MAJOR;
112-
header["version_minor"] = REDOT_VERSION_MINOR;
109+
//redot header
110+
Dictionary redot_header;
111+
redot_header["version_major"] = REDOT_VERSION_MAJOR;
112+
redot_header["version_minor"] = REDOT_VERSION_MINOR;
113113
#if REDOT_VERSION_PATCH
114-
header["version_patch"] = REDOT_VERSION_PATCH;
114+
redot_header["version_patch"] = REDOT_VERSION_PATCH;
115115
#else
116-
header["version_patch"] = 0;
116+
redot_header["version_patch"] = 0;
117117
#endif
118-
header["version_status"] = REDOT_VERSION_STATUS;
119-
header["version_status_version"] = REDOT_VERSION_STATUS_VERSION;
120-
header["version_build"] = REDOT_VERSION_BUILD;
121-
header["version_full_name"] = REDOT_VERSION_FULL_NAME;
118+
redot_header["version_status"] = REDOT_VERSION_STATUS;
119+
redot_header["version_status_version"] = REDOT_VERSION_STATUS_VERSION;
120+
redot_header["version_build"] = REDOT_VERSION_BUILD;
121+
redot_header["version_full_name"] = REDOT_VERSION_FULL_NAME;
122122

123123
#if REAL_T_IS_DOUBLE
124-
header["precision"] = "double";
124+
redot_header["precision"] = "double";
125125
#else
126-
header["precision"] = "single";
126+
redot_header["precision"] = "single";
127127
#endif
128128

129-
api_dump["header"] = header;
129+
api_dump["redot_header"] = redot_header;
130+
}
131+
132+
{
133+
//godot compatible header
134+
Dictionary godot_compat_header;
135+
godot_compat_header["version_major"] = GODOT_VERSION_MAJOR;
136+
godot_compat_header["version_minor"] = GODOT_VERSION_MINOR;
137+
#if GODOT_VERSION_PATCH
138+
godot_compat_header["version_patch"] = GODOT_VERSION_PATCH;
139+
#else
140+
godot_compat_header["version_patch"] = 0;
141+
#endif
142+
godot_compat_header["version_status"] = GODOT_VERSION_STATUS;
143+
godot_compat_header["version_build"] = GODOT_VERSION_BUILD;
144+
godot_compat_header["version_full_name"] = GODOT_VERSION_FULL_NAME;
145+
146+
#if REAL_T_IS_DOUBLE
147+
godot_compat_header["precision"] = "double";
148+
#else
149+
godot_compat_header["precision"] = "single";
150+
#endif
151+
152+
api_dump["header"] = godot_compat_header;
130153
}
131154

132155
const uint32_t vec3_elems = 3;

0 commit comments

Comments
 (0)