From d6369978b95a9804eeaa6934785e5145a8773be8 Mon Sep 17 00:00:00 2001 From: drfrag666 Date: Thu, 31 May 2018 11:00:19 +0200 Subject: [PATCH] - Merged "- fixed Windows XP compatibility for MSVC 2017 targets". Workaround initially implemented for MSVC 2015 is enabled with all Windows XP compatible toolsets regardless of Visual Studio version (patch by _mental_) Still it's a VS bug. --- src/CMakeLists.txt | 5 ----- src/win32/i_system.cpp | 9 +++++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5d05cb02b..53aea2974 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -457,11 +457,6 @@ if( NOT MSVC ) add_definitions( -D__forceinline=inline ) endif() -# Fix stat in v140_xp (broken in RTM and Update 1 so far) -if( MSVC AND ( CMAKE_GENERATOR_TOOLSET STREQUAL "v140_xp" OR CMAKE_GENERATOR_TOOLSET STREQUAL "v141_xp" ) ) - add_definitions( -D_stat64i32=VS14Stat ) -endif() - if( UNIX ) CHECK_LIBRARY_EXISTS( rt clock_gettime "" CLOCK_GETTIME_IN_RT ) if( NOT CLOCK_GETTIME_IN_RT ) diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index df30c5aa2..9816da725 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -1461,16 +1461,17 @@ FString I_GetLongPathName(FString shortpath) #if defined(_MSC_VER) && defined(_USING_V110_SDK71_) //========================================================================== // -// VS14Stat +// _stat64i32 // -// Work around an issue where stat doesn't work with v140_xp. This was -// supposedly fixed, but as of Update 1 continues to not function on XP. +// Work around an issue where stat() function doesn't work +// with Windows XP compatible toolset. +// It uses GetFileInformationByHandleEx() which requires Windows Vista. // //========================================================================== #include -int VS14Stat(const char *path, struct _stat64i32 *buffer) +int _stat64i32(const char *path, struct _stat64i32 *buffer) { WIN32_FILE_ATTRIBUTE_DATA data; if(!GetFileAttributesEx(path, GetFileExInfoStandard, &data))