From 27c0129c9931f8124d9ce5492b8822e1ade662c3 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 1 Dec 2015 15:50:24 +0100 Subject: [PATCH] windows: fsocc and fix wpd2html install --- src/utils/pathut.cpp | 14 +++++++++++--- src/windows/mkinstdir.sh | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/utils/pathut.cpp b/src/utils/pathut.cpp index 8ba9899e..acfc8065 100644 --- a/src/utils/pathut.cpp +++ b/src/utils/pathut.cpp @@ -151,10 +151,19 @@ string path_wingettempfilename(TCHAR *pref) #endif -bool fsocc(const string &path, int *pc, long long *blocks) +bool fsocc(const string &path, int *pc, long long *avmbs) { + static const int FSOCC_MB = 1024*1024; #ifdef _WIN32 - return false; + ULARGE_INTEGER freebytesavail; + ULARGE_INTEGER totalbytes; + if (!GetDiskFreeSpaceEx(path.c_str(), &freebytesavail, + &totalbytes, NULL)) { + return false; + } + *pc = int(100 * double(freebytesavail) / double(totalbytes)); + *avmbs = totalbytes / FSOCC_MB; + return true; #else #ifdef sun struct statvfs buf; @@ -178,7 +187,6 @@ bool fsocc(const string &path, int *pc, long long *blocks) *pc = int(fpc); if (blocks) { *blocks = 0; -#define FSOCC_MB (1024*1024) if (buf.f_bsize > 0) { int ratio = buf.f_bsize > FSOCC_MB ? buf.f_bsize / FSOCC_MB : FSOCC_MB / buf.f_bsize; diff --git a/src/windows/mkinstdir.sh b/src/windows/mkinstdir.sh index c4daca43..9dabb527 100644 --- a/src/windows/mkinstdir.sh +++ b/src/windows/mkinstdir.sh @@ -209,7 +209,9 @@ copywpd() chkcp $MINGWBIN/libgcc_s_dw2-1.dll $DEST chkcp $MINGWBIN/libstdc++-6.dll $DEST chkcp $ZLIB/zlib1.dll $DEST + chkcp $QTBIN/libwinpthread-1.dll $DEST } + copychm() { DEST=$FILTERS