From 0987f8b4792bfe28eac6cefa4b7de580a8aad32e Mon Sep 17 00:00:00 2001 From: Trihedraf Date: Sun, 9 May 2021 06:11:02 -0700 Subject: [PATCH] remove windows specific code because stat works for this on windows --- Source/utils/file_util.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Source/utils/file_util.cpp b/Source/utils/file_util.cpp index 75b1b73fb..797b62cd0 100644 --- a/Source/utils/file_util.cpp +++ b/Source/utils/file_util.cpp @@ -3,6 +3,7 @@ #include #include +#include #include @@ -25,7 +26,6 @@ #endif #if _POSIX_C_SOURCE >= 200112L || defined(_BSD_SOURCE) || defined(__APPLE__) -#include #include #else #include @@ -82,25 +82,11 @@ bool FileExists(const char *path) bool GetFileSize(const char *path, std::uintmax_t *size) { -#if defined(_WIN64) || defined(_WIN32) - const auto pathUtf16 = ToWideChar(path); - if (pathUtf16 == nullptr) { - LogError("UTF-8 -> UTF-16 conversion error code {}", ::GetLastError()); - return false; - } - WIN32_FILE_ATTRIBUTE_DATA attr; - if (!GetFileAttributesExW(&pathUtf16[0], GetFileExInfoStandard, &attr)) { - return false; - } - *size = (attr.nFileSizeHigh) << (sizeof(attr.nFileSizeHigh) * 8) | attr.nFileSizeLow; - return true; -#else struct ::stat statResult; if (::stat(path, &statResult) == -1) return false; *size = static_cast(statResult.st_size); return true; -#endif } bool ResizeFile(const char *path, std::uintmax_t size)