From eb4c85566e5ca4bcf40a4a811677c06ceb2369ec Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 14 Dec 2023 13:06:20 -0500 Subject: [PATCH] fix up port of platform::disk_free() to Windows --- src/platform.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform.cpp b/src/platform.cpp index c8a964076f..b2061fe681 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -42,7 +42,6 @@ #define PSAPI_VERSION 2 #include -#include #include // for _get_osfhandle() #include #include @@ -1079,8 +1078,9 @@ double platform::disk_free(const std::string &path) } } #else define(_WIN32) - bigint free_bytes; - if (GetDiskFreeSpaceEx(path.c_str(), &free_bytes, nullptr, nullptr)) disk_free = free_bytes; + bigint free_bytes = 0; + if (GetDiskFreeSpaceEx(path.c_str(), (PULARGE_INTEGER) &free_bytes, nullptr, nullptr)) + disk_free = free_bytes; #endif return disk_free; }