summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-08 22:24:45 +0800
committerruki <[email protected]>2020-11-08 22:24:45 +0800
commit4fa2abe9d7c6a13696b657dc24ed1966e6fec487 (patch)
tree0d23ebaf6432864f43cdbf6a69ee8d5234d49719
parent6f58d347401697543a16d0a7f93cb5b401908fb0 (diff)
fix compile error for mingw/macos
-rw-r--r--core/src/xmake/io/iscygpty.c10
1 files changed, 7 insertions, 3 deletions
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
}