diff --git a/src/ddhx/ddhx.d b/src/ddhx/ddhx.d index 03ca33c..8481c5b 100644 --- a/src/ddhx/ddhx.d +++ b/src/ddhx/ddhx.d @@ -460,7 +460,7 @@ private size_t format8lud(char *buffer, long v) { debug import std.conv : text; - enum I64MAX = 10_000_000_000_000_000_000; + enum ulong I64MAX = 10_000_000_000_000_000_000UL; immutable static string decTable = "0123456789"; size_t pos; bool pad = true; diff --git a/src/ddhx/terminal.d b/src/ddhx/terminal.d index adeb769..d666531 100644 --- a/src/ddhx/terminal.d +++ b/src/ddhx/terminal.d @@ -22,6 +22,35 @@ private import core.sys.posix.sys.ioctl; private import core.sys.posix.unistd; private import core.sys.posix.termios; + version (CRuntime_Musl) { + alias uint tcflag_t; + alias uint speed_t; + alias char cc_t; + private enum TCSANOW = 0; + private enum NCCS = 32; + private enum ICANON = 2; + private enum ECHO = 10; + private enum TIOCGWINSZ = 0x5413; + private struct termios { + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + cc_t c_line; + cc_t[NCCS] c_cc; + speed_t __c_ispeed; + speed_t __c_ospeed; + } + private struct winsize { + ushort ws_row; + ushort ws_col; + ushort ws_xpixel; + ushort ws_ypixel; + } + private extern (C) int tcgetattr(int fd, termios *termios_p); + private extern (C) int tcsetattr(int fd, int a, termios *termios_p); + private extern (C) int ioctl(int fd, ulong request, ...); + } private enum TERM_ATTR = ~(ICANON | ECHO); private __gshared termios old_tio, new_tio; }