From e1f41a323159828fef7a3319768d1bc34fc127d3 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 4 Feb 2018 05:38:23 +0000 Subject: [PATCH] file.cpp/.h: wstring version of FileExists for Win32 only --- source/common/file.cpp | 18 ++++-------------- source/common/file.h | 2 ++ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/source/common/file.cpp b/source/common/file.cpp index 9e4e448..515ceb9 100644 --- a/source/common/file.cpp +++ b/source/common/file.cpp @@ -38,22 +38,12 @@ bool FileExists(std::string filename){ } -bool FileExists(std::wstring filename) { - #if defined (WIN32) - return PathFileExists(filename.c_str()); - -#else - - struct stat bufferData; - - if (stat(filename.c_str(), &bufferData) == -1) { - return false; - } +bool FileExists(std::wstring filename) { -#endif + return PathFileExists(filename.c_str()); - return true; +} -} \ No newline at end of file +#endif \ No newline at end of file diff --git a/source/common/file.h b/source/common/file.h index 69303d7..65410fa 100644 --- a/source/common/file.h +++ b/source/common/file.h @@ -29,6 +29,8 @@ #endif bool FileExists(std::string filename); +#if defined(WIN32) bool FileExists(std::wstring filename); +#endif #endif \ No newline at end of file -- 2.39.2