Skip to content

Commit

Permalink
Distinguish Bool
Browse files Browse the repository at this point in the history
  • Loading branch information
hazeycode committed Nov 23, 2024
1 parent dee36b5 commit 44760ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/zglfw.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

//--------------------------------------------------------------------------------------------------
//
Expand Down

0 comments on commit 44760ef

Please sign in to comment.