LibCore: Implement System::isatty on Windows

Also fixes a bug introduced in 642b7b6a5e: Core::System functions
expect a handle now, so we have to use _get_osfhandle in STD*_FILENO.
This commit is contained in:
stasoid 2025-02-15 18:37:38 +05:00 committed by Andrew Kaster
commit 2ac53794c3
Notes: github-actions[bot] 2025-04-13 16:20:27 +00:00
3 changed files with 10 additions and 5 deletions

View file

@ -7,15 +7,11 @@
#include <LibCore/File.h>
#include <LibCore/System.h>
#include <fcntl.h>
#if !defined(AK_OS_WINDOWS)
# include <unistd.h>
#else
# include <WinSock2.h>
# define STDIN_FILENO _fileno(stdin)
# define STDOUT_FILENO _fileno(stdout)
# define STDERR_FILENO _fileno(stderr)
# include <AK/Windows.h>
#endif
namespace Core {