diff --git a/ext/libclementine-common/core/closure.cpp b/ext/libclementine-common/core/closure.cpp index e2c27c13f..ccca3bae1 100644 --- a/ext/libclementine-common/core/closure.cpp +++ b/ext/libclementine-common/core/closure.cpp @@ -33,7 +33,7 @@ ClosureBase::~ClosureBase() { CallbackClosure::CallbackClosure( QObject* sender, const char* signal, - std::function callback) + std::tr1::function callback) : ClosureBase(new ObjectHelper(sender, signal, this)), callback_(callback) { } @@ -67,7 +67,7 @@ void Unpack(QList*) {} _detail::ClosureBase* NewClosure( QObject* sender, const char* signal, - std::function callback) { + std::tr1::function callback) { return new _detail::CallbackClosure( sender, signal, callback); } diff --git a/ext/libclementine-common/core/closure.h b/ext/libclementine-common/core/closure.h index ca85ce91d..55b31ca9f 100644 --- a/ext/libclementine-common/core/closure.h +++ b/ext/libclementine-common/core/closure.h @@ -18,6 +18,8 @@ #ifndef CLOSURE_H #define CLOSURE_H +#include + #include #include #include @@ -155,12 +157,12 @@ class CallbackClosure : public ClosureBase { CallbackClosure( QObject* sender, const char* signal, - std::function callback); + std::tr1::function callback); virtual void Invoke(); private: - std::function callback_; + std::tr1::function callback_; }; } // namespace _detail @@ -191,7 +193,7 @@ _detail::ClosureBase* NewClosure( _detail::ClosureBase* NewClosure( QObject* sender, const char* signal, - std::function callback); + std::tr1::function callback); void DoAfter(QObject* receiver, const char* slot, int msec); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 51dc461ee..ae7f0e0a1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.6) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fpermissive -U__STRICT_ANSI__") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fpermissive -Wno-c++11-narrowing -U__STRICT_ANSI__") if(USE_SYSTEM_GMOCK) include_directories(${GMOCK_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}) diff --git a/tests/concurrentrun_test.cpp b/tests/concurrentrun_test.cpp index 09eb3f21f..5e06dc54d 100644 --- a/tests/concurrentrun_test.cpp +++ b/tests/concurrentrun_test.cpp @@ -1,6 +1,7 @@ #include "gtest/gtest.h" #include +#include #include #include @@ -143,7 +144,7 @@ TEST(ConcurrentRunTest, ConcurrentRunVoidBindFunctionStart) { A a; int nb = 10; - QFuture future = ConcurrentRun::Run(&threadpool, std::bind(&A::f, &a, &nb)); + QFuture future = ConcurrentRun::Run(&threadpool, std::tr1::bind(&A::f, &a, &nb)); QFutureWatcher watcher; watcher.setFuture(future); QEventLoop loop;