From ea9fd1e7a218e0c7c0cf469719e05d9c7cdd5cec Mon Sep 17 00:00:00 2001 From: mochalins <117967760+mochalins@users.noreply.github.com> Date: Tue, 24 Sep 2024 00:55:49 +0900 Subject: [PATCH] fix: macos passing baud rate to `setspeed` fns --- src/backend/macos.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/macos.zig b/src/backend/macos.zig index 3304c58..4463d0f 100644 --- a/src/backend/macos.zig +++ b/src/backend/macos.zig @@ -25,20 +25,20 @@ pub fn configure( if (config.input_baud_rate) |ibr| { switch (std.posix.errno( - c.cfsetospeed(@ptrCast(&settings), config.baud_rate), + c.cfsetospeed(@ptrCast(&settings), @intFromEnum(config.baud_rate)), )) { .SUCCESS => {}, else => |err| std.posix.unexpectedErrno(err), } switch (std.posix.errno( - c.cfsetispeed(@ptrCast(&settings), ibr), + c.cfsetispeed(@ptrCast(&settings), @intFromEnum(ibr)), )) { .SUCCESS => {}, else => |err| std.posix.unexpectedErrno(err), } } else { switch (std.posix.errno( - c.cfsetspeed(@ptrCast(&settings), config.baud_rate), + c.cfsetspeed(@ptrCast(&settings), @intFromEnum(config.baud_rate)), )) { .SUCCESS => {}, else => |err| std.posix.unexpectedErrno(err),