Skip to content

Commit 2b17192

Browse files
committed
fix(terminal): fix conditional binding for musl
I got the compiles import syntax wrong and the extern C.
1 parent 8f3d584 commit 2b17192

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

terminal.d

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,11 @@ version(CRuntime_Musl) {
393393
// We define our own bindings whenever the import fails.
394394
// When druntime catches up, this block can slowly be removed,
395395
// although for backward compatibility we might want to keep it.
396-
static if (!__traits(compiles, import core.sys.posix.termios : tcgetattr)) {
397-
int tcgetattr (int, struct termios *);
398-
int tcsetattr (int, int, const struct termios *);
396+
static if (!__traits(compiles, { import core.sys.posix.termios : tcgetattr; })) {
397+
extern (C) {
398+
int tcgetattr (int, termios *);
399+
int tcsetattr (int, int, const termios *);
400+
}
399401
}
400402
}
401403

0 commit comments

Comments
 (0)