diff options
| author | ruki <[email protected]> | 2020-11-08 22:24:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-08 22:24:45 +0800 |
| commit | 4fa2abe9d7c6a13696b657dc24ed1966e6fec487 (patch) | |
| tree | 0d23ebaf6432864f43cdbf6a69ee8d5234d49719 /core/src | |
| parent | 6f58d347401697543a16d0a7f93cb5b401908fb0 (diff) | |
fix compile error for mingw/macos
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/xmake/io/iscygpty.c | 10 |
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 } |
