]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
fixed client area origin handling in wxGTK
[wxWidgets.git] / src / msw / utils.cpp
index 686ff7d697f34c4a5a858bc51accbe79c09fa1f5..d34d0ede3e952404493523bd24f5a35fcef40995 100644 (file)
 #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;