]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
blind fix for wxGIFDecoder::ReadGIF
[wxWidgets.git] / src / unix / utilsunx.cpp
index 0581126a283e06b858fb6242053c1c8603a9cdd8..ffbde3589f2f1224a7cbf9b62d25ed26e7ea1479 100644 (file)
@@ -29,7 +29,7 @@
 #include "wx/stream.h"
 
 #ifdef HAVE_STATFS
 #include "wx/stream.h"
 
 #ifdef HAVE_STATFS
-#  ifdef __DARWIN__
+#  ifdef __BSD__
 #    include <sys/param.h>
 #    include <sys/mount.h>
 #  else
 #    include <sys/param.h>
 #    include <sys/mount.h>
 #  else
 #  endif
 #endif // HAVE_STATFS
 
 #  endif
 #endif // HAVE_STATFS
 
+#ifdef HAVE_STATVFS
+    #include <sys/statvfs.h>
+
+    #define statfs statvfs
+#endif // HAVE_STATVFS
+
 #if wxUSE_GUI
     #include "wx/unix/execute.h"
 #endif
 #if wxUSE_GUI
     #include "wx/unix/execute.h"
 #endif
@@ -1007,8 +1013,7 @@ long wxGetFreeMemory()
 
 bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
 {
 
 bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
 {
-#ifdef HAVE_STATFS
-
+#if defined(HAVE_STATFS) || defined(HAVE_STATVFS)
     struct statfs fs;
     if ( statfs(path, &fs) != 0 )
     {
     struct statfs fs;
     if ( statfs(path, &fs) != 0 )
     {
@@ -1017,6 +1022,9 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
         return FALSE;
     }
 
         return FALSE;
     }
 
+    // under Solaris we might have to use fs.f_frsize instead as I think it
+    // may be a multiple of the block size in general (TODO)
+
     if ( pTotal )
     {
         *pTotal = wxLongLong(fs.f_blocks) * fs.f_bsize;
     if ( pTotal )
     {
         *pTotal = wxLongLong(fs.f_blocks) * fs.f_bsize;