Skip to content

Commit 418ce44

Browse files
committed
Avoid error from -Werror=type-limits on GCC 11
1 parent 54136ee commit 418ce44

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/godot.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,14 @@ GDExtensionBool GDExtensionBinding::init(GDExtensionInterfaceGetProcAddress p_ge
271271
} else if (internal::godot_version.minor != GODOT_VERSION_MINOR) {
272272
compatible = internal::godot_version.minor > GODOT_VERSION_MINOR;
273273
} else {
274+
#if GODOT_VERSION_PATCH > 0
274275
compatible = internal::godot_version.patch >= GODOT_VERSION_PATCH;
276+
#else
277+
// Since internal::godot_version.patch is unsigned, it must be greater
278+
// than or equal to GODOT_VERSION_PATCH which is zero. This avoids an
279+
// error from -Werror=type-limits on GCC.
280+
compatible = true;
281+
#endif
275282
}
276283
if (!compatible) {
277284
// We need to use snprintf() here because vformat() uses Variant, and we haven't loaded

0 commit comments

Comments
 (0)