From 4b8ffd3f999e2b8ac9f431fbd9b1235527762d7a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 26 Oct 2016 06:21:07 +0200 Subject: compat/util: move stuff around --- compat/util.hpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'compat') diff --git a/compat/util.hpp b/compat/util.hpp index f9e9dea9..80ab4270 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -15,13 +15,11 @@ template using mem = std::shared_ptr; template using ptr = std::unique_ptr; -template -void run_in_thread_async(QObject* obj, F&& fun) -{ - QObject src; - src.moveToThread(obj->thread()); - QObject::connect(&src, &QObject::destroyed, obj, std::move(fun), Qt::AutoConnection); -} +#if defined(_MSC_VER) && !defined(Q_CREATOR_RUN) +# define DEFUN_WARN_UNUSED _Check_return_ +#else +# define DEFUN_WARN_UNUSED __attribute__((warn_unused_result)) +#endif namespace detail { @@ -113,8 +111,11 @@ auto run_in_thread_sync(QObject* obj, F&& fun) return traits::pass(std::move(ret)); } -#if defined(_MSC_VER) && !defined(Q_CREATOR_RUN) -# define DEFUN_WARN_UNUSED _Check_return_ -#else -# define DEFUN_WARN_UNUSED __attribute__((warn_unused_result)) -#endif +template +void run_in_thread_async(QObject* obj, F&& fun) +{ + QObject src; + src.moveToThread(obj->thread()); + QObject::connect(&src, &QObject::destroyed, obj, std::move(fun), Qt::AutoConnection); +} + -- cgit v1.2.3