From 0a518ad7d0aa94df529af2c39c2b34457b6d1015 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 19 Oct 2016 14:44:43 +0200 Subject: compat, tracker/pt: add warn_unused_result compat macro --- compat/util.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compat') diff --git a/compat/util.hpp b/compat/util.hpp index abcc9ba2..3a28ce90 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -112,3 +112,9 @@ auto run_in_thread_sync(QObject* obj, F&& fun) cvar.wait(guard); 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 -- cgit v1.2.3