mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Rename version defines to GODOT_VERSION_* to match GDExtension godot-cpp
This commit is contained in:
parent
74907876d3
commit
97ee05e9b7
53 changed files with 220 additions and 197 deletions
|
@ -106,16 +106,16 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
|
|||
{
|
||||
//header
|
||||
Dictionary header;
|
||||
header["version_major"] = VERSION_MAJOR;
|
||||
header["version_minor"] = VERSION_MINOR;
|
||||
#if VERSION_PATCH
|
||||
header["version_patch"] = VERSION_PATCH;
|
||||
header["version_major"] = GODOT_VERSION_MAJOR;
|
||||
header["version_minor"] = GODOT_VERSION_MINOR;
|
||||
#if GODOT_VERSION_PATCH
|
||||
header["version_patch"] = GODOT_VERSION_PATCH;
|
||||
#else
|
||||
header["version_patch"] = 0;
|
||||
#endif
|
||||
header["version_status"] = VERSION_STATUS;
|
||||
header["version_build"] = VERSION_BUILD;
|
||||
header["version_full_name"] = VERSION_FULL_NAME;
|
||||
header["version_status"] = GODOT_VERSION_STATUS;
|
||||
header["version_build"] = GODOT_VERSION_BUILD;
|
||||
header["version_full_name"] = GODOT_VERSION_FULL_NAME;
|
||||
|
||||
#if REAL_T_IS_DOUBLE
|
||||
header["precision"] = "double";
|
||||
|
@ -1603,8 +1603,8 @@ Error GDExtensionAPIDump::validate_extension_json_file(const String &p_path) {
|
|||
int major = header["version_major"];
|
||||
int minor = header["version_minor"];
|
||||
|
||||
ERR_FAIL_COND_V_MSG(major != VERSION_MAJOR, ERR_INVALID_DATA, vformat("JSON API dump is for a different engine version (%d) than this one (%d)", major, VERSION_MAJOR));
|
||||
ERR_FAIL_COND_V_MSG(minor > VERSION_MINOR, ERR_INVALID_DATA, vformat("JSON API dump is for a newer version of the engine: %d.%d", major, minor));
|
||||
ERR_FAIL_COND_V_MSG(major != GODOT_VERSION_MAJOR, ERR_INVALID_DATA, vformat("JSON API dump is for a different engine version (%d) than this one (%d)", major, GODOT_VERSION_MAJOR));
|
||||
ERR_FAIL_COND_V_MSG(minor > GODOT_VERSION_MINOR, ERR_INVALID_DATA, vformat("JSON API dump is for a newer version of the engine: %d.%d", major, minor));
|
||||
}
|
||||
|
||||
bool failed = false;
|
||||
|
|
|
@ -243,23 +243,23 @@ GDExtensionInterfaceFunctionPtr gdextension_get_proc_address(const char *p_name)
|
|||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
static void gdextension_get_godot_version(GDExtensionGodotVersion *r_godot_version) {
|
||||
r_godot_version->major = VERSION_MAJOR;
|
||||
r_godot_version->minor = VERSION_MINOR;
|
||||
r_godot_version->patch = VERSION_PATCH;
|
||||
r_godot_version->string = VERSION_FULL_NAME;
|
||||
r_godot_version->major = GODOT_VERSION_MAJOR;
|
||||
r_godot_version->minor = GODOT_VERSION_MINOR;
|
||||
r_godot_version->patch = GODOT_VERSION_PATCH;
|
||||
r_godot_version->string = GODOT_VERSION_FULL_NAME;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gdextension_get_godot_version2(GDExtensionGodotVersion2 *r_godot_version) {
|
||||
r_godot_version->major = VERSION_MAJOR;
|
||||
r_godot_version->minor = VERSION_MINOR;
|
||||
r_godot_version->patch = VERSION_PATCH;
|
||||
r_godot_version->hex = VERSION_HEX;
|
||||
r_godot_version->status = VERSION_STATUS;
|
||||
r_godot_version->build = VERSION_BUILD;
|
||||
r_godot_version->hash = VERSION_HASH;
|
||||
r_godot_version->timestamp = VERSION_TIMESTAMP;
|
||||
r_godot_version->string = VERSION_FULL_NAME;
|
||||
r_godot_version->major = GODOT_VERSION_MAJOR;
|
||||
r_godot_version->minor = GODOT_VERSION_MINOR;
|
||||
r_godot_version->patch = GODOT_VERSION_PATCH;
|
||||
r_godot_version->hex = GODOT_VERSION_HEX;
|
||||
r_godot_version->status = GODOT_VERSION_STATUS;
|
||||
r_godot_version->build = GODOT_VERSION_BUILD;
|
||||
r_godot_version->hash = GODOT_VERSION_HASH;
|
||||
r_godot_version->timestamp = GODOT_VERSION_TIMESTAMP;
|
||||
r_godot_version->string = GODOT_VERSION_FULL_NAME;
|
||||
}
|
||||
|
||||
// Memory Functions
|
||||
|
|
|
@ -307,12 +307,12 @@ Error GDExtensionLibraryLoader::parse_gdextension_file(const String &p_path) {
|
|||
|
||||
bool compatible = true;
|
||||
// Check version lexicographically.
|
||||
if (VERSION_MAJOR != compatibility_minimum[0]) {
|
||||
compatible = VERSION_MAJOR > compatibility_minimum[0];
|
||||
} else if (VERSION_MINOR != compatibility_minimum[1]) {
|
||||
compatible = VERSION_MINOR > compatibility_minimum[1];
|
||||
if (GODOT_VERSION_MAJOR != compatibility_minimum[0]) {
|
||||
compatible = GODOT_VERSION_MAJOR > compatibility_minimum[0];
|
||||
} else if (GODOT_VERSION_MINOR != compatibility_minimum[1]) {
|
||||
compatible = GODOT_VERSION_MINOR > compatibility_minimum[1];
|
||||
} else {
|
||||
compatible = VERSION_PATCH >= compatibility_minimum[2];
|
||||
compatible = GODOT_VERSION_PATCH >= compatibility_minimum[2];
|
||||
}
|
||||
if (!compatible) {
|
||||
ERR_PRINT(vformat("GDExtension only compatible with Godot version %d.%d.%d or later: %s", compatibility_minimum[0], compatibility_minimum[1], compatibility_minimum[2], p_path));
|
||||
|
@ -334,15 +334,15 @@ Error GDExtensionLibraryLoader::parse_gdextension_file(const String &p_path) {
|
|||
}
|
||||
|
||||
compatible = true;
|
||||
if (VERSION_MAJOR != compatibility_maximum[0]) {
|
||||
compatible = VERSION_MAJOR < compatibility_maximum[0];
|
||||
} else if (VERSION_MINOR != compatibility_maximum[1]) {
|
||||
compatible = VERSION_MINOR < compatibility_maximum[1];
|
||||
if (GODOT_VERSION_MAJOR != compatibility_maximum[0]) {
|
||||
compatible = GODOT_VERSION_MAJOR < compatibility_maximum[0];
|
||||
} else if (GODOT_VERSION_MINOR != compatibility_maximum[1]) {
|
||||
compatible = GODOT_VERSION_MINOR < compatibility_maximum[1];
|
||||
}
|
||||
#if VERSION_PATCH
|
||||
#if GODOT_VERSION_PATCH
|
||||
// #if check to avoid -Wtype-limits warning when 0.
|
||||
else {
|
||||
compatible = VERSION_PATCH <= compatibility_maximum[2];
|
||||
compatible = GODOT_VERSION_PATCH <= compatibility_maximum[2];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue