From 4fa2abe9d7c6a13696b657dc24ed1966e6fec487 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 8 Nov 2020 22:24:45 +0800 Subject: fix compile error for mingw/macos --- core/src/xmake/io/iscygpty.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'core/src') diff --git a/core/src/xmake/io/iscygpty.c b/core/src/xmake/io/iscygpty.c index 5d8db1df7..fc5a5b8da 100644 --- a/core/src/xmake/io/iscygpty.c +++ b/core/src/xmake/io/iscygpty.c @@ -56,7 +56,9 @@ # endif #endif /* USE_FILEEXTD */ -#define USE_DYNFILEID // we need enable it for supporting xp +#if _WIN32_WINNT >= 0x0600 +# define USE_DYNFILEID // we need enable it for supporting xp +#endif #ifdef USE_DYNFILEID typedef BOOL (WINAPI *pfnGetFileInformationByHandleEx)( HANDLE hFile, @@ -104,9 +106,9 @@ static void setup_fileid_api(void) /* Check if the fd handle is a cygwin/msys's pty. */ int is_cygpty(HANDLE h) { -#ifdef STUB_IMPL +#if defined(STUB_IMPL) return 0; -#else +#elif _WIN32_WINNT >= 0x0600 int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * (MAX_PATH - 1); FILE_NAME_INFO *nameinfo; WCHAR *p = NULL; @@ -159,6 +161,8 @@ int is_cygpty(HANDLE h) } free(nameinfo); return (p != NULL); +#else + return 0; #endif } -- cgit v1.3.1