fix(terminal): fix conditional binding for musl

I got the compiles import syntax wrong and the extern C.
This commit is contained in:
Sebastiaan Koppe 2025-05-28 17:39:13 +02:00
parent 8f3d584698
commit 2b17192187
1 changed files with 5 additions and 3 deletions

View File

@ -393,9 +393,11 @@ version(CRuntime_Musl) {
// We define our own bindings whenever the import fails. // We define our own bindings whenever the import fails.
// When druntime catches up, this block can slowly be removed, // When druntime catches up, this block can slowly be removed,
// although for backward compatibility we might want to keep it. // although for backward compatibility we might want to keep it.
static if (!__traits(compiles, import core.sys.posix.termios : tcgetattr)) { static if (!__traits(compiles, { import core.sys.posix.termios : tcgetattr; })) {
int tcgetattr (int, struct termios *); extern (C) {
int tcsetattr (int, int, const struct termios *); int tcgetattr (int, termios *);
int tcsetattr (int, int, const termios *);
}
} }
} }