David Herman
02/27/2023, 8:39 PMtermios
in K/N. termios
is a struct which has a bitflag field called c_lflag
; its type is platform.posix.tcflag_t
which appears to be an int on mac and a uint on linux.
I'm trying to do some bit logic like this: newTermios.c_lflag.and((_ECHO_.or(_ICANON_.or(_IEXTEN_))).inv())
(equivalent to c_lflag & ~(ECHO | ICNON | IEXTEN)
in C).
In order to support both targets, I thought ECHO.or(...) as tcflag_t
would work, but I'm getting a warning that the cast will never succeed.
What's the right solution here?.toUInt()
on Linux and not on Macephemient
02/27/2023, 8:46 PM.convert()
David Herman
02/27/2023, 8:46 PMcast
)ephemient
02/27/2023, 8:50 PMLandry Norris
02/27/2023, 9:08 PMephemient
02/27/2023, 9:10 PM(fun (x: Double) { println(x) } as (Number) -> Unit).invoke(1 as Int)
works 😛