Merge pull request #1323 from dsnopek/gcc-type-limits-error

Prevent `-Wtype-limits` warning on GCC 11 due to unsigned comparison
pull/1324/head
Rémi Verschelde 2023-12-01 10:36:59 +01:00 committed by GitHub
commit 17137b2e2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -271,7 +271,12 @@ GDExtensionBool GDExtensionBinding::init(GDExtensionInterfaceGetProcAddress p_ge
} else if (internal::godot_version.minor != GODOT_VERSION_MINOR) { } else if (internal::godot_version.minor != GODOT_VERSION_MINOR) {
compatible = internal::godot_version.minor > GODOT_VERSION_MINOR; compatible = internal::godot_version.minor > GODOT_VERSION_MINOR;
} else { } else {
#if GODOT_VERSION_PATCH > 0
compatible = internal::godot_version.patch >= GODOT_VERSION_PATCH; compatible = internal::godot_version.patch >= GODOT_VERSION_PATCH;
#else
// Prevent -Wtype-limits warning due to unsigned comparison.
compatible = true;
#endif
} }
if (!compatible) { if (!compatible) {
// We need to use snprintf() here because vformat() uses Variant, and we haven't loaded // We need to use snprintf() here because vformat() uses Variant, and we haven't loaded