showing up as undefined on macos. But as far as I can tell, that constant should be supported on the mac platform?
David Herman
03/16/2023, 8:27 PM
What's weird is when I try to compile my code on a CI, it fails. But when I compile it on an old MBP I have lying around, compilation works. (But the IDE shows the symbol as unresolvable)
David Herman
03/16/2023, 8:28 PM
Here's the code:
Copy code
val numColumns = memScoped {
val winsize = alloc<winsize>()
ioctl(STDOUT_FILENO, TIOCGWINSZ, winsize.ptr)
winsize.ws_col.toInt()
}
winsize
and
ioctl
are found correctly.
David Herman
03/16/2023, 8:29 PM
Note that this code lives in
posixMain
, not
macosMain
or anything more specific, in case that's what's causing the problem?
David Herman
03/16/2023, 8:30 PM
(And in my project I target both macos x64 and macos arm64)
David Herman
03/16/2023, 10:16 PM
I believe I've solved the issue. My CI is building at least.
I suspect what is happening here is that the
TIOCGWINSZ
constant provided by Linux is different from
TIOCGWINSZ
provided by Mac, so that the intersection stdlib provided at the