summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-12-01 10:36:59 +0100
committerGitHub <noreply@github.com>2023-12-01 10:36:59 +0100
commit17137b2e2ecdeb5638a885d28498164d35a2130d (patch)
tree564514ff80363fb572c642f1d0d03fe55dcf0fe9
parent54136ee8357c5140a3775c54f08db5f7deda2058 (diff)
parentcad5be53b1dd81416d644ef5002c85951f07adcc (diff)
downloadredot-cpp-17137b2e2ecdeb5638a885d28498164d35a2130d.tar.gz
Merge pull request #1323 from dsnopek/gcc-type-limits-error
Prevent `-Wtype-limits` warning on GCC 11 due to unsigned comparison
-rw-r--r--src/godot.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/godot.cpp b/src/godot.cpp
index ee4156b..5c2aaa6 100644
--- a/src/godot.cpp
+++ b/src/godot.cpp
@@ -271,7 +271,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