Merge branch 'master' into jgrpp
# Conflicts: # src/company_gui.cpp # src/group_gui.cpp # src/newgrf.cpp # src/newgrf_debug_gui.cpp # src/saveload/saveload.cpp
This commit is contained in:
@@ -256,16 +256,17 @@ bool FiosIsHiddenFile(const struct dirent *ent)
|
||||
return (ent->dir->fd.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)) != 0;
|
||||
}
|
||||
|
||||
bool FiosGetDiskFreeSpace(const char *path, uint64 *tot)
|
||||
std::optional<uint64_t> FiosGetDiskFreeSpace(const std::string &path)
|
||||
{
|
||||
UINT sem = SetErrorMode(SEM_FAILCRITICALERRORS); // disable 'no-disk' message box
|
||||
|
||||
ULARGE_INTEGER bytes_free;
|
||||
bool retval = GetDiskFreeSpaceEx(OTTD2FS(path).c_str(), &bytes_free, nullptr, nullptr);
|
||||
if (retval && tot != nullptr) *tot = bytes_free.QuadPart;
|
||||
|
||||
SetErrorMode(sem); // reset previous setting
|
||||
return retval;
|
||||
|
||||
if (retval) return bytes_free.QuadPart;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
static int ParseCommandLine(char *line, char **argv, int max_argc)
|
||||
|
||||
Reference in New Issue
Block a user