X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eadd7bd2cbef3ca0bde3e93ad9671a783e4e90b0..8c290175b3b4a6892d429345ff61a255843684eb:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 686ff7d697..d34d0ede3e 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -31,9 +31,11 @@ #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/app.h" - #include "wx/cursor.h" #include "wx/intl.h" #include "wx/log.h" +#if wxUSE_GUI + #include "wx/cursor.h" +#endif #endif //WX_PRECOMP // In some mingws there is a missing extern "C" int the winsock header, @@ -463,7 +465,7 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) PULARGE_INTEGER); GetDiskFreeSpaceEx_t - pGetDiskFreeSpaceEx = ::GetProcAddress + pGetDiskFreeSpaceEx = (GetDiskFreeSpaceEx_t)::GetProcAddress ( ::GetModuleHandle(_T("kernel32.dll")), #if wxUSE_UNICODE @@ -501,6 +503,10 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) else #endif // Win32 { + // there's a problem with drives larger than 2GB, GetDiskFreeSpaceEx() + // should be used instead - but if it's not available, fall back on + // GetDiskFreeSpace() nevertheless... + DWORD lSectorsPerCluster, lBytesPerSector, lNumberOfFreeClusters, @@ -519,8 +525,6 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) return FALSE; } - // there's a problem with drives larger than 2GB on non Win32!! - // let's calculate it, nevertheless.... wxLongLong lBytesPerCluster = lSectorsPerCluster; lBytesPerCluster *= lBytesPerSector;