From 6ea99568a5007c13f44f96f0ae624e4c02b1a729 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 18 Jul 2019 17:18:25 +0000 Subject: [PATCH] move Q_REQUIRED_RESULT to compiler specific definitions Signed-off-by: Ivailo Monev --- src/core/global/qglobal.h.cmake | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/global/qglobal.h.cmake b/src/core/global/qglobal.h.cmake index c56156063..8440dea85 100644 --- a/src/core/global/qglobal.h.cmake +++ b/src/core/global/qglobal.h.cmake @@ -281,6 +281,7 @@ QT_USE_NAMESPACE # define Q_ALIGNOF(type) __alignof__(type) # define Q_TYPEOF(expr) __typeof__(expr) # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) +# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result)) # define Q_LIKELY(expr) __builtin_expect(!!(expr), true) # define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false) # if !defined(QT_MOC_CPP) @@ -301,6 +302,7 @@ QT_USE_NAMESPACE # define Q_ALIGNOF(type) __alignof__(type) # define Q_TYPEOF(expr) __typeof__(expr) # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) +# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result)) # define Q_LIKELY(expr) __builtin_expect(!!(expr), true) # define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false) # if !defined(QT_MOC_CPP) @@ -434,14 +436,6 @@ QT_USE_NAMESPACE # define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC) #endif -#ifndef Q_REQUIRED_RESULT -# if defined(Q_CC_GNU) || defined(Q_CC_CLANG) -# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result)) -# else -# define Q_REQUIRED_RESULT -# endif -#endif - /* The window system, must be one of: (Q_WS_x) -- 2.11.0