From e9273e85281d534e59359ee3ca40f080d74466af Mon Sep 17 00:00:00 2001 From: David Snopek Date: Thu, 30 Nov 2023 15:20:08 -0600 Subject: [PATCH] Avoid error from -Werror=type-limits on GCC 11 (cherry picked from commit cad5be53b1dd81416d644ef5002c85951f07adcc) --- src/godot.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/godot.cpp b/src/godot.cpp index b40049f..1621b20 100644 --- a/src/godot.cpp +++ b/src/godot.cpp @@ -264,7 +264,12 @@ GDExtensionBool GDExtensionBinding::init(GDExtensionInterfaceGetProcAddress p_ge } else if (internal::godot_version.minor != GODOT_VERSION_MINOR) { compatible = internal::godot_version.minor > GODOT_VERSION_MINOR; } else { +#if GODOT_VERSION_PATCH > 0 compatible = internal::godot_version.patch >= GODOT_VERSION_PATCH; +#else + // Prevent -Wtype-limits warning due to unsigned comparison. + compatible = true; +#endif } if (!compatible) { // We need to use snprintf() here because vformat() uses Variant, and we haven't loaded