Skip to content

Commit

Permalink
fix: macos backend C termios missing ptrCasts
Browse files Browse the repository at this point in the history
  • Loading branch information
mochalins committed Sep 23, 2024
1 parent 8f540c2 commit 5857276
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/backend/macos.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,25 @@ pub fn configure(
var settings = try std.posix.tcgetattr(port.handle);
const orig_termios = settings;

c.cfmakeraw(&settings);
c.cfmakeraw(@ptrCast(&settings));

if (config.input_baud_rate) |ibr| {
switch (std.posix.errno(c.cfsetospeed(&settings, config.baud_rate))) {
switch (std.posix.errno(
c.cfsetospeed(@ptrCast(&settings), config.baud_rate),
)) {
.SUCCESS => {},
else => |err| std.posix.unexpectedErrno(err),
}
switch (std.posix.errno(c.cfsetispeed(&settings, ibr))) {
switch (std.posix.errno(
c.cfsetispeed(@ptrCast(&settings), ibr),
)) {
.SUCCESS => {},
else => |err| std.posix.unexpectedErrno(err),
}
} else {
switch (std.posix.errno(c.cfsetspeed(&settings, config.baud_rate))) {
switch (std.posix.errno(
c.cfsetspeed(@ptrCast(&settings), config.baud_rate),
)) {
.SUCCESS => {},
else => |err| std.posix.unexpectedErrno(err),
}
Expand Down

0 comments on commit 5857276

Please sign in to comment.