From a205e1e2c1ad8b4e8c6e1ce92f374f2af5b12123 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 28 May 2024 20:49:21 -0700 Subject: [PATCH] pkg/freetype: use c_ulong which isn't 64-bit on windows --- pkg/freetype/face.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/freetype/face.zig b/pkg/freetype/face.zig index e7dc7b0fa..94c3e2931 100644 --- a/pkg/freetype/face.zig +++ b/pkg/freetype/face.zig @@ -116,11 +116,11 @@ pub const Face = struct { alloc: Allocator, tag: Tag, ) (Allocator.Error || Error)!?[]u8 { - const tag_u64: u64 = @intCast(@as(u32, @bitCast(tag))); + const tag_c: c_ulong = @intCast(@as(u32, @bitCast(tag))); // Get the length of the table in bytes var len: c_ulong = 0; - var res = c.FT_Load_Sfnt_Table(self.handle, tag_u64, 0, null, &len); + var res = c.FT_Load_Sfnt_Table(self.handle, tag_c, 0, null, &len); _ = intToError(res) catch |err| return err; // If our length is zero we don't have a table. @@ -129,7 +129,7 @@ pub const Face = struct { // Allocate a buffer to hold the table and load it const buf = try alloc.alloc(u8, len); errdefer alloc.free(buf); - res = c.FT_Load_Sfnt_Table(self.handle, tag_u64, 0, buf.ptr, &len); + res = c.FT_Load_Sfnt_Table(self.handle, tag_c, 0, buf.ptr, &len); _ = intToError(res) catch |err| return err; return buf; @@ -137,9 +137,9 @@ pub const Face = struct { /// Check whether a given SFNT table is available in a face. pub fn hasSfntTable(self: Face, tag: Tag) bool { - const tag_u64: u64 = @intCast(@as(u32, @bitCast(tag))); + const tag_c: c_ulong = @intCast(@as(u32, @bitCast(tag))); var len: c_ulong = 0; - const res = c.FT_Load_Sfnt_Table(self.handle, tag_u64, 0, null, &len); + const res = c.FT_Load_Sfnt_Table(self.handle, tag_c, 0, null, &len); _ = intToError(res) catch return false; return len != 0; }