X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f17876f2b49e831d817e0ce683ae4f4d1ee9fb1..ef3a5e0aae003c29941c7d41ed6becea4287752d:/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