Commit 158edf18 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix Windows build; patches frmo ezyang

parent e7f7ce78
......@@ -21,12 +21,12 @@ int is_console__(int fd) {
/* TTY must be a character device */
return 0;
h = get_osfhandle(fd);
h = (HANDLE)_get_osfhandle(fd);
/* Broken handle can't be terminal */
return 0;
if (GetConsoleMode(h, &st) == INVALID_HANDLE_VALUE) {
if (!GetConsoleMode(h, &st)) {
/* GetConsoleMode appears to fail when it's not a TTY. In
particular, it's what most of our terminal functions
assume works, so if it doesn't work for all intents
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment