From 2b17192187f12b1835738abb9064bcb3e4ded2dd Mon Sep 17 00:00:00 2001 From: Sebastiaan Koppe Date: Wed, 28 May 2025 17:39:13 +0200 Subject: [PATCH] fix(terminal): fix conditional binding for musl I got the compiles import syntax wrong and the extern C. --- terminal.d | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/terminal.d b/terminal.d index 81e8476..8d2c6cf 100644 --- a/terminal.d +++ b/terminal.d @@ -393,9 +393,11 @@ version(CRuntime_Musl) { // We define our own bindings whenever the import fails. // When druntime catches up, this block can slowly be removed, // although for backward compatibility we might want to keep it. - static if (!__traits(compiles, import core.sys.posix.termios : tcgetattr)) { - int tcgetattr (int, struct termios *); - int tcsetattr (int, int, const struct termios *); + static if (!__traits(compiles, { import core.sys.posix.termios : tcgetattr; })) { + extern (C) { + int tcgetattr (int, termios *); + int tcsetattr (int, int, const termios *); + } } }