diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2024-02-19 08:03:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 08:03:10 +0100 |
commit | 34edb5b49a32b7c64847d6a4735eb036cd9a9ba5 (patch) | |
tree | 7804a309a41a80c23c82cce43060bf9f73d5a4d9 | |
parent | ae51db75e7a4b4d111cf5dcbf596bc2c8c8a3222 (diff) | |
parent | e076405f30be922d152dee102879668d68538c7e (diff) | |
download | redot-engine-34edb5b49a32b7c64847d6a4735eb036cd9a9ba5.tar.gz |
Merge pull request #88527 from akien-mga/gdextension-fix-Wtype-limits-warning
GDExtension: Fix `-Wtype-limits` warning in `compatibility_maximum` patch check
-rw-r--r-- | core/extension/gdextension.cpp | 6 | ||||
-rw-r--r-- | core/version.h | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp index 029f52d5a6..60487c5a52 100644 --- a/core/extension/gdextension.cpp +++ b/core/extension/gdextension.cpp @@ -929,9 +929,13 @@ Error GDExtensionResourceLoader::load_gdextension_resource(const String &p_path, compatible = VERSION_MAJOR < compatibility_maximum[0]; } else if (VERSION_MINOR != compatibility_maximum[1]) { compatible = VERSION_MINOR < compatibility_maximum[1]; - } else { + } +#if VERSION_PATCH + // #if check to avoid -Wtype-limits warning when 0. + else { compatible = VERSION_PATCH <= compatibility_maximum[2]; } +#endif if (!compatible) { ERR_PRINT(vformat("GDExtension only compatible with Godot version %s or earlier: %s", compat_string, p_path)); diff --git a/core/version.h b/core/version.h index abb81312ac..05cc25bc1c 100644 --- a/core/version.h +++ b/core/version.h @@ -47,13 +47,8 @@ // forward-compatible. // Example: "3.1" #define VERSION_BRANCH _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) -#if VERSION_PATCH // Example: "3.1.4" #define VERSION_NUMBER VERSION_BRANCH "." _MKSTR(VERSION_PATCH) -#else // patch is 0, we don't include it in the "pretty" version number. -// Example: "3.1" instead of "3.1.0" -#define VERSION_NUMBER VERSION_BRANCH -#endif // VERSION_PATCH // Version number encoded as hexadecimal int with one byte for each number, // for easy comparison from code. |