From eeed9ce598fca623d593d7867b2e07c98d4ae74e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 15 Oct 2026 01:46:45 +0200 Subject: [PATCH] std.c: fix width of termios flag packed structs for haiku --- lib/std/c.zig | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/std/c.zig b/lib/std/c.zig index e653d602b5a8dc1fe465483e5a098d21dacd67a1..3652dc045f37a8c5ceabd7991e32e0f6fc45c1fe 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -9107,7 +9107,7 @@ pub const tc_iflag_t = switch (native_os) { IMAXBEL: bool = false, _: u18 = 0, }, - .haiku => packed struct(u32) { + .haiku => packed struct(u16) { IGNBRK: bool = false, BRKINT: bool = false, IGNPAR: bool = false, @@ -9121,7 +9121,7 @@ pub const tc_iflag_t = switch (native_os) { IXON: bool = false, IXANY: bool = false, IXOFF: bool = false, - _: u19 = 0, + _: u3 = 0, }, .illumos => packed struct(u32) { IGNBRK: bool = false, @@ -9235,8 +9235,24 @@ pub const tc_oflag_t = switch (native_os) { WRAP: bool = false, _: u14 = 0, }, + .haiku => packed struct(u16) { + OPOST: bool = false, + OLCUC: bool = false, + ONLCR: bool = false, + OCRNL: bool = false, + ONOCR: bool = false, + ONLRET: bool = false, + OFILL: bool = false, + OFDEL: bool = false, + NLDLY: u1 = 0, + CRDLY: u2 = 0, + TABDLY: u2 = 0, + BSDLY: u1 = 0, + VTDLY: u1 = 0, + FFDLY: u1 = 0, + }, // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L69-L97 - .haiku, .emscripten, .serenity => packed struct(u32) { + .emscripten, .serenity => packed struct(u32) { OPOST: bool = false, OLCUC: bool = false, ONLCR: bool = false, @@ -9349,7 +9365,7 @@ pub const tc_cflag_t = switch (native_os) { MDMBUF: bool = false, _: u11 = 0, }, - .haiku => packed struct(u32) { + .haiku => packed struct(u16) { _0: u5 = 0, CSIZE: CSIZE = .CS7, CSTOPB: bool = false, @@ -9361,7 +9377,7 @@ pub const tc_cflag_t = switch (native_os) { XLOBLK: bool = false, CTSFLOW: bool = false, RTSFLOW: bool = false, - _: u17 = 0, + _: u1 = 0, }, .illumos => packed struct(u32) { _0: u4 = 0, @@ -9483,7 +9499,7 @@ pub const tc_lflag_t = switch (native_os) { _30: u1 = 0, NOFLSH: bool = false, }, - .haiku => packed struct(u32) { + .haiku => packed struct(u16) { ISIG: bool = false, ICANON: bool = false, XCASE: bool = false, @@ -9499,7 +9515,7 @@ pub const tc_lflag_t = switch (native_os) { ECHOKE: bool = false, FLUSHO: bool = false, PENDIN: bool = false, - _: u17 = 0, + _: u1 = 0, }, .illumos => packed struct(u32) { ISIG: bool = false, -- 2.54.0