Commit b1bb093d authored by Nikolai Kosjar's avatar Nikolai Kosjar Committed by Erik Verbruggen

C++: Fix Qt dependency (Q_UNLIKELY) in 3rdparty/cplusplus

Change-Id: I37ffb657c9e042cc1c186895efd9c58fe6e332fd
Reviewed-by: default avatarPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent bf3d1424
......@@ -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 {
......
......@@ -24,7 +24,6 @@
#include "CPlusPlusForwardDeclarations.h"
#include "Token.h"
namespace CPlusPlus {
class CPLUSPLUS_EXPORT Lexer
......@@ -100,7 +99,7 @@ private:
inline void yyinp()
{
_yychar = *++_currentChar;
if (Q_UNLIKELY(_yychar == '\n'))
if (CPLUSPLUS_UNLIKELY(_yychar == '\n'))
pushLineStartOffset();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment