From 44760efae4ec068140ecd8624f16fc1dd2017106 Mon Sep 17 00:00:00 2001 From: Chris Heyes <22148308+hazeycode@users.noreply.github.com> Date: Sat, 23 Nov 2024 21:19:43 +0000 Subject: [PATCH] Distinguish Bool --- src/zglfw.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/zglfw.zig b/src/zglfw.zig index 4c8ca73..0db636c 100644 --- a/src/zglfw.zig +++ b/src/zglfw.zig @@ -25,9 +25,9 @@ fn cIntCast(value: anytype) c_int { // Misc // //-------------------------------------------------------------------------------------------------- -pub const Bool = c_int; -pub const TRUE: Bool = 1; -pub const FALSE: Bool = 0; +pub const Bool = enum(c_int) { _ }; +pub const TRUE: Bool = @enumFromInt(1); +pub const FALSE: Bool = @enumFromInt(0); pub const InitHint = enum(c_int) { joystick_hat_buttons = 0x00050001, @@ -525,12 +525,12 @@ pub fn getGamepadState(gamepad: Gamepad) Error!Gamepad.State { try maybeError(); return .{}; } -extern fn glfwGetGamepadState(Gamepad, *Gamepad.State) c_int; +extern fn glfwGetGamepadState(Gamepad, *Gamepad.State) Bool; pub fn updateGamepadMappings(mappings: [:0]const u8) bool { return glfwUpdateGamepadMappings(mappings) == TRUE; } -extern fn glfwUpdateGamepadMappings(mappings: [*:0]const u8) c_int; +extern fn glfwUpdateGamepadMappings(mappings: [*:0]const u8) Bool; //-------------------------------------------------------------------------------------------------- //