fix mingw build

master
Andrew Kelley 2017-10-03 09:32:38 -04:00
parent f86684f410
commit 3af35fc1df
1 changed files with 4 additions and 1 deletions

View File

@ -643,11 +643,13 @@ int os_get_cwd(Buf *out_cwd) {
#define is_wprefix(s, prefix) \
(wcsncmp((s), (prefix), sizeof(prefix) / sizeof(WCHAR) - 1) == 0)
static bool is_stderr_cyg_pty(void) {
#if defined(__MINGW32__)
return false;
#else
HANDLE stderr_handle = GetStdHandle(STD_ERROR_HANDLE);
if (stderr_handle == INVALID_HANDLE_VALUE)
return false;
HANDLE h;
int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * MAX_PATH;
FILE_NAME_INFO *nameinfo;
WCHAR *p = NULL;
@ -695,6 +697,7 @@ static bool is_stderr_cyg_pty(void) {
}
free(nameinfo);
return (p != NULL);
#endif
}
#endif