X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f17876f2b49e831d817e0ce683ae4f4d1ee9fb1..00c813596e3eefdd028365acf9542355937e5531:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 63c92780b9..ffbde3589f 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -37,6 +37,12 @@ # endif #endif // HAVE_STATFS +#ifdef HAVE_STATVFS + #include + + #define statfs statvfs +#endif // HAVE_STATVFS + #if wxUSE_GUI #include "wx/unix/execute.h" #endif @@ -1005,11 +1011,9 @@ 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 ) { @@ -1018,6 +1022,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; @@ -1033,7 +1040,6 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) return FALSE; } -#endif // ---------------------------------------------------------------------------- // env vars