Build fixes for mingw-w64

This commit is contained in:
John Maguire 2012-11-13 14:41:15 +01:00
parent 7d65d425e0
commit 79318cc4e1
3 changed files with 28 additions and 16 deletions

View File

@ -16,13 +16,15 @@
***************************************************************************/
#include "analyzerbase.h"
#include "engines/enginebase.h"
#include <cmath> //interpolate()
#include <QEvent> //event()
#include <QPainter>
#include <QPaintEvent>
#include <QtDebug>
#include "engines/enginebase.h"
// INSTRUCTIONS Base2D
// 1. do anything that depends on height() in init(), Base2D will call it before you are shown

View File

@ -143,14 +143,6 @@ void WmdmLister::ShutDown() {
metaObject()->invokeMethod(this, "ReallyShutdown", Qt::BlockingQueuedConnection);
}
template <typename F>
qint64 GetSpaceValue(F f) {
DWORD low, high;
f(&low, &high);
return (qint64)high << 32 | (qint64)low;
}
WmdmLister::DeviceInfo WmdmLister::ReadDeviceInfo(IWMDMDevice2* device) {
qLog(Debug) << "Reading device info";
@ -424,13 +416,28 @@ void WmdmLister::DoUpdateDriveFreeSpace(const QString& id) {
emit DeviceChanged(id);
}
namespace {
qint64 GetSpaceValue(
IWMDMStorageGlobals* globals,
LONG (IWMDMStorageGlobals::*f)(DWORD*,DWORD*)) {
DWORD low, high;
((globals)->*(f))(&low, &high);
return (qint64)high << 32 | (qint64)low;
}
}
void WmdmLister::UpdateFreeSpace(DeviceInfo* info) {
IWMDMStorageGlobals* globals;
info->storage_->GetStorageGlobals(&globals);
info->total_bytes_ = GetSpaceValue(boost::bind(&IWMDMStorageGlobals::GetTotalSize, globals, _1, _2));
info->free_bytes_ = GetSpaceValue(boost::bind(&IWMDMStorageGlobals::GetTotalFree, globals, _1, _2));
info->free_bytes_ -= GetSpaceValue(boost::bind(&IWMDMStorageGlobals::GetTotalBad, globals, _1, _2));
DWORD low, high;
globals->GetTotalSize(&low, &high);
info->total_bytes_ = (qint64)high << 32 | (qint64)low;
globals->GetTotalFree(&low, &high);
info->free_bytes_ = (qint64)high << 32 | (qint64)low;
globals->Release();
}

View File

@ -22,14 +22,17 @@
#ifndef AMAROK_ENGINEBASE_H
#define AMAROK_ENGINEBASE_H
#include <QUrl>
#include <QObject>
#include <QList>
#include <cstdint>
#include <sys/types.h>
#include <vector>
#include <boost/noncopyable.hpp>
#include <QList>
#include <QObject>
#include <QUrl>
#include "engine_fwd.h"
namespace Engine {