From 61badb6af71be4e48f78bbe6c20a49e29069557b Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Fri, 3 Jan 2025 13:51:10 +0000 Subject: [PATCH] libc: add isatty() --- lib/std/libc/libc.c3 | 1 + lib/std/libc/os/win32.c3 | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/std/libc/libc.c3 b/lib/std/libc/libc.c3 index 8c547f4ab..e59935298 100644 --- a/lib/std/libc/libc.c3 +++ b/lib/std/libc/libc.c3 @@ -109,6 +109,7 @@ extern fn ZString getenv(ZString name); extern fn ZString gets(char* buffer); extern fn Tm* gmtime(Time_t* timer); extern fn Tm* gmtime_r(Time_t *timer, Tm* buf) @if(!env::WIN32); +extern fn CInt isatty(Fd fd) @if(!env::WIN32); extern fn CLong labs(CLong x); extern fn LongDivResult ldiv(CLong number, CLong denom); extern fn Tm* localtime(Time_t* timer); diff --git a/lib/std/libc/os/win32.c3 b/lib/std/libc/os/win32.c3 index b480fb7eb..583de4907 100644 --- a/lib/std/libc/os/win32.c3 +++ b/lib/std/libc/os/win32.c3 @@ -10,6 +10,7 @@ extern fn CInt _fseeki64(CFile, long, int); def fseek = _fseeki64; extern fn CLong _ftelli64(CFile); def ftell = _ftelli64; extern fn Errno _get_timezone(CLong *timezone); extern fn Tm* _gmtime64_s(Tm* buf, Time_t *timer); +extern fn CInt _isatty(Fd fd); def isatty = _isatty; extern fn Tm* _localtime64_s(Tm* buf, Time_t *timer); extern fn Time_t _mkgmtime64(Tm* timeptr); def timegm = _mkgmtime64; extern fn Time_t _mktime64(Tm *timeptr); def mktime = _mktime64;