mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
build: fix freetype C enum signedness for MSVC
MSVC translates C enums as signed int, while GCC/Clang uses unsigned int. The freetype Zig bindings hardcode c_uint for enum backing types, causing type mismatches when compiling with MSVC target. Fix by adding @intCast at call sites where enum values are passed to C functions, and @bitCast for the glyph format tag extraction where bit-shift operations require unsigned integers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,7 @@ pub const Face = struct {
|
||||
|
||||
/// Select a given charmap by its encoding tag (as listed in freetype.h).
|
||||
pub fn selectCharmap(self: Face, encoding: Encoding) Error!void {
|
||||
return intToError(c.FT_Select_Charmap(self.handle, @intFromEnum(encoding)));
|
||||
return intToError(c.FT_Select_Charmap(self.handle, @intCast(@intFromEnum(encoding))));
|
||||
}
|
||||
|
||||
/// Call FT_Request_Size to request the nominal size (in points).
|
||||
@@ -99,7 +99,7 @@ pub const Face = struct {
|
||||
pub fn renderGlyph(self: Face, render_mode: RenderMode) Error!void {
|
||||
return intToError(c.FT_Render_Glyph(
|
||||
self.handle.*.glyph,
|
||||
@intFromEnum(render_mode),
|
||||
@intCast(@intFromEnum(render_mode)),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user