fix mingw build

This commit is contained in:
Andrew Kelley 2017-10-03 09:32:38 -04:00
parent f86684f410
commit 3af35fc1df

View File

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