Remove workarounds for unsupported compilers

Change-Id: Ie28ff761b0bae13c6ebdf7dd649cfbba28e0fc2c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Orgad Shaneh
2017-04-14 16:08:34 +03:00
committed by Orgad Shaneh
parent 531fba61f0
commit e1660a18cf
6 changed files with 5 additions and 48 deletions

View File

@@ -33,9 +33,7 @@
#include <string> #include <string>
#include <cstdio> // for putchar #include <cstdio> // for putchar
#if defined(_MSC_VER) && (_MSC_VER < 1800) #if defined(__INTEL_COMPILER) && !defined(va_copy)
# define va_copy(dst, src) ((dst) = (src))
#elif defined(__INTEL_COMPILER) && !defined(va_copy)
# define va_copy __va_copy # define va_copy __va_copy
#endif #endif

View File

@@ -32,9 +32,7 @@
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
#if defined(_MSC_VER) && (_MSC_VER < 1800) #if defined(__INTEL_COMPILER) && !defined(va_copy)
# define va_copy(dst, src) ((dst) = (src))
#elif defined(__INTEL_COMPILER) && !defined(va_copy)
# define va_copy __va_copy # define va_copy __va_copy
#endif #endif

View File

@@ -25,20 +25,8 @@
#include "Token.h" #include "Token.h"
#include "DiagnosticClient.h" #include "DiagnosticClient.h"
#include <cstdio> #include <cstdio>
#include <vector>
#if !(__cplusplus > 199711L || __GXX_EXPERIMENTAL_CXX0X__ || _MSC_VER >= 1600 || defined( _LIBCPP_VERSION )) \
|| (defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402))
#define USE_TR1
#endif
#if defined(_MSC_VER) && _MSC_VER < 1600
# include <map>
#elif defined(USE_TR1)
# include <tr1/unordered_map>
#else
#include <unordered_map> #include <unordered_map>
#endif #include <vector>
namespace CPlusPlus { namespace CPlusPlus {
@@ -185,14 +173,7 @@ private:
std::vector<Token> *_comments; std::vector<Token> *_comments;
std::vector<unsigned> _lineOffsets; std::vector<unsigned> _lineOffsets;
std::vector<PPLine> _ppLines; std::vector<PPLine> _ppLines;
#if defined(_MSC_VER) && _MSC_VER < 1600
// MSVC2008 and earlier do not implement TR1.
typedef std::map<unsigned, std::pair<unsigned, unsigned> > TokenLineColumn;
#elif defined(USE_TR1)
typedef std::tr1::unordered_map<unsigned, std::pair<unsigned, unsigned> > TokenLineColumn;
#else
typedef std::unordered_map<unsigned, std::pair<unsigned, unsigned> > TokenLineColumn; typedef std::unordered_map<unsigned, std::pair<unsigned, unsigned> > TokenLineColumn;
#endif
TokenLineColumn _expandedLineColumn; TokenLineColumn _expandedLineColumn;
MemoryPool *_pool; MemoryPool *_pool;
AST *_ast; AST *_ast;

View File

@@ -73,9 +73,3 @@ private:
uint qHash(const CPlusPlus::LookupItem &result); uint qHash(const CPlusPlus::LookupItem &result);
} // namespace CPlusPlus } // namespace CPlusPlus
#if defined(Q_CC_MSVC) && _MSC_VER <= 1300
//this ensures that code outside QmlJS can use the hash function
//it also a workaround for some compilers
inline uint qHash(const CPlusPlus::LookupItem &item) { return CPlusPlus::qHash(item); }
#endif

View File

@@ -38,17 +38,9 @@
#include "sqlite3.h" #include "sqlite3.h"
#if defined(Q_CC_GNU)
#define QTC_THREAD_LOCAL __thread
#elif defined(Q_CC_MSVC)
#define QTC_THREAD_LOCAL __declspec(thread)
#else
#define QTC_THREAD_LOCAL thread_local
#endif
#define SIZE_OF_BYTEARRAY_ARRAY(array) sizeof(array)/sizeof(QByteArray) #define SIZE_OF_BYTEARRAY_ARRAY(array) sizeof(array)/sizeof(QByteArray)
QTC_THREAD_LOCAL SqliteDatabaseBackend *sqliteDatabaseBackend = nullptr; thread_local SqliteDatabaseBackend *sqliteDatabaseBackend = nullptr;
SqliteDatabaseBackend::SqliteDatabaseBackend() SqliteDatabaseBackend::SqliteDatabaseBackend()
: databaseHandle(nullptr), : databaseHandle(nullptr),

View File

@@ -25,13 +25,7 @@
#pragma once #pragma once
#if !(__cplusplus > 199711L || __GXX_EXPERIMENTAL_CXX0X__ || _MSC_VER >= 1600 || defined( _LIBCPP_VERSION )) || \
(defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402))
# include <algorithm>
#else // C++11
#include <utility> #include <utility>
#endif
namespace Utils { namespace Utils {
/// RAII object to save a value, and restore it when the scope is left. /// RAII object to save a value, and restore it when the scope is left.