Merge pull request #436 from aldenml/allow-xp-compilation

Allow xp compilation with the use GetFileInformationByHandleEx
This commit is contained in:
Arvid Norberg 2016-01-25 18:41:31 -05:00
commit 9ff1882cfd
1 changed files with 2 additions and 0 deletions

View File

@ -2050,6 +2050,7 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
} }
} }
#if _WIN32_WINNT >= 0x0600 // only if Windows Vista or newer
if ((m_open_mode & sparse) == 0) if ((m_open_mode & sparse) == 0)
{ {
typedef DWORD (WINAPI *GetFileInformationByHandleEx_t)(HANDLE hFile typedef DWORD (WINAPI *GetFileInformationByHandleEx_t)(HANDLE hFile
@ -2097,6 +2098,7 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
set_file_valid_data(m_file_handle, s); set_file_valid_data(m_file_handle, s);
} }
} }
#endif // if Windows Vista
#else // NON-WINDOWS #else // NON-WINDOWS
struct stat st; struct stat st;
if (fstat(native_handle(), &st) != 0) if (fstat(native_handle(), &st) != 0)