OSDN Git Service

move Q_REQUIRED_RESULT to compiler specific definitions
authorIvailo Monev <xakepa10@laimg.moc>
Thu, 18 Jul 2019 17:18:25 +0000 (17:18 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Thu, 18 Jul 2019 17:18:25 +0000 (17:18 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/global/qglobal.h.cmake

index c561560..8440dea 100644 (file)
@@ -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)