]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
Changed CanPaste to just check IsSupported.
[wxWidgets.git] / src / unix / utilsunx.cpp
index 0581126a283e06b858fb6242053c1c8603a9cdd8..9ff30199ca6138fa76e439e253d7f10942ebae4c 100644 (file)
@@ -29,7 +29,7 @@
 #include "wx/stream.h"
 
 #ifdef HAVE_STATFS
-#  ifdef __DARWIN__
+#  ifdef __BSD__
 #    include <sys/param.h>
 #    include <sys/mount.h>
 #  else
 #  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
@@ -1005,10 +1011,10 @@ long wxGetFreeMemory()
     return -1;
 }
 
+#ifndef __WXMAC__
 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 )
     {
@@ -1017,6 +1023,9 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
         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;
@@ -1032,6 +1041,7 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
 
     return FALSE;
 }
+#endif
 
 // ----------------------------------------------------------------------------
 // env vars