diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-04-17 14:43:36 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-04-18 11:34:32 +0200 |
commit | b1bb093d157acf228162444ba3a7ced4b81f8ca2 (patch) | |
tree | cb1dcc581f2d82ec511ec38e2263c1967f6b64a3 /src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h | |
parent | bf3d142418872d9c0050f375ebfe39748944d8cf (diff) |
C++: Fix Qt dependency (Q_UNLIKELY) in 3rdparty/cplusplus
Change-Id: I37ffb657c9e042cc1c186895efd9c58fe6e332fd
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h')
-rw-r--r-- | src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h b/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h index 5c24b2ee3c..7a3b2e0f3b 100644 --- a/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h +++ b/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h @@ -24,9 +24,28 @@ #include <cstdlib> #include <cstddef> -#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 <qglobal.h> - +# 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 { |