From b1bb093d157acf228162444ba3a7ced4b81f8ca2 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 17 Apr 2013 14:43:36 +0200 Subject: C++: Fix Qt dependency (Q_UNLIKELY) in 3rdparty/cplusplus Change-Id: I37ffb657c9e042cc1c186895efd9c58fe6e332fd Reviewed-by: Przemyslaw Gorszkowski Reviewed-by: Erik Verbruggen --- .../cplusplus/CPlusPlusForwardDeclarations.h | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h') diff --git a/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h b/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h index 5c24b2ee3cf..7a3b2e0f3bb 100644 --- a/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h +++ b/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h @@ -24,9 +24,28 @@ #include #include -#ifndef CPLUSPLUS_WITHOUT_QT +#ifdef CPLUSPLUS_WITHOUT_QT +# ifndef CPLUSPLUS_UNLIKELY +# ifdef __GNUC__ +# define CPLUSPLUS_UNLIKELY(expr) __builtin_expect(!!(expr), false) +# else +# define CPLUSPLUS_UNLIKELY(expr) (expr) +# endif +# endif +# define CPLUSPLUS_EXPORT +#else # include - +# ifndef CPLUSPLUS_UNLIKELY +# ifdef Q_UNLIKELY +# define CPLUSPLUS_UNLIKELY(expr) Q_UNLIKELY(expr) +# else // pre 4.8.something +# ifdef __GCC__ +# define CPLUSPLUS_UNLIKELY(expr) __builtin_expect(!!(expr), false) +# else +# define CPLUSPLUS_UNLIKELY(expr) (expr) +# endif +# endif +# endif # if defined(CPLUSPLUS_BUILD_LIB) # define CPLUSPLUS_EXPORT Q_DECL_EXPORT # elif defined(CPLUSPLUS_BUILD_STATIC_LIB) @@ -34,8 +53,6 @@ # else # define CPLUSPLUS_EXPORT Q_DECL_IMPORT # endif -#else -# define CPLUSPLUS_EXPORT #endif namespace CPlusPlus { -- cgit v1.2.3