Commit e1660a18 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Remove workarounds for unsupported compilers

Change-Id: Ie28ff761b0bae13c6ebdf7dd649cfbba28e0fc2c
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 531fba61
......@@ -33,9 +33,7 @@
#include <string>
#include <cstdio> // for putchar
#if defined(_MSC_VER) && (_MSC_VER < 1800)
# define va_copy(dst, src) ((dst) = (src))
#elif defined(__INTEL_COMPILER) && !defined(va_copy)
#if defined(__INTEL_COMPILER) && !defined(va_copy)
# define va_copy __va_copy
#endif
......
......@@ -32,9 +32,7 @@
#include <algorithm>
#include <utility>
#if defined(_MSC_VER) && (_MSC_VER < 1800)
# define va_copy(dst, src) ((dst) = (src))
#elif defined(__INTEL_COMPILER) && !defined(va_copy)
#if defined(__INTEL_COMPILER) && !defined(va_copy)
# define va_copy __va_copy
#endif
......
......@@ -25,21 +25,9 @@
#include "Token.h"
#include "DiagnosticClient.h"
#include <cstdio>
#include <unordered_map>
#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>
#endif
namespace CPlusPlus {
class CPLUSPLUS_EXPORT TranslationUnit
......@@ -185,14 +173,7 @@ private:
std::vector<Token> *_comments;
std::vector<unsigned> _lineOffsets;
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;
#endif
TokenLineColumn _expandedLineColumn;
MemoryPool *_pool;
AST *_ast;
......
......@@ -73,9 +73,3 @@ private:
uint qHash(const CPlusPlus::LookupItem &result);
} // 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
......@@ -38,17 +38,9 @@
#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)
QTC_THREAD_LOCAL SqliteDatabaseBackend *sqliteDatabaseBackend = nullptr;
thread_local SqliteDatabaseBackend *sqliteDatabaseBackend = nullptr;
SqliteDatabaseBackend::SqliteDatabaseBackend()
: databaseHandle(nullptr),
......
......@@ -25,13 +25,7 @@
#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>
#endif
#include <utility>
namespace Utils {
/// RAII object to save a value, and restore it when the scope is left.
......
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