mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Correct the comptime GTK atLeast() function
The comptime path of the GTK `atLeast()` version function fails to take the preceeding portion of the version into account. For example version 5.1.0 is incorrectly marked as less than 4.16.7 due to the minor version (1) being less than the minor we are comparing against (16). For example, building against GTK 4.17.1: Before: version.atLeast(4,16,2) -> false After: version.atLeast(4,16,2) -> true
This commit is contained in:
@ -19,8 +19,9 @@ pub inline fn atLeast(
|
||||
// compiling against unknown symbols and makes runtime checks
|
||||
// very slightly faster.
|
||||
if (comptime c.GTK_MAJOR_VERSION < major or
|
||||
c.GTK_MINOR_VERSION < minor or
|
||||
c.GTK_MICRO_VERSION < micro) return false;
|
||||
(c.GTK_MAJOR_VERSION == major and c.GTK_MINOR_VERSION < minor) or
|
||||
(c.GTK_MAJOR_VERSION == major and c.GTK_MINOR_VERSION == minor and c.GTK_MICRO_VERSION < micro))
|
||||
return false;
|
||||
|
||||
// If we're in comptime then we can't check the runtime version.
|
||||
if (@inComptime()) return true;
|
||||
|
Reference in New Issue
Block a user