Commit 78fb7f44 authored by Alessandro Portale's avatar Alessandro Portale

Revert "Utils: Remove old compiler support code"

This reverts commit 8a32bcc5.

Broke build with MSVC 2015, update 3

Change-Id: Icb59b70fb00ea2a2ecc8d26c8177d21d82aaccf2
Reviewed-by: Alessandro Portale's avatarAlessandro Portale <alessandro.portale@qt.io>
parent 8a32bcc5
......@@ -45,6 +45,19 @@
#include <utility>
#include <vector>
#pragma push_macro("constexpr")
#ifndef __cpp_constexpr
#define constexpr
#endif
#pragma push_macro("noexcept")
#ifdef __clang__
#define __cpp_noexcept 201003
#endif
#ifndef __cpp_noexcept
#define noexcept
#endif
#ifdef UNIT_TESTS
#define unitttest_public public
#else
......@@ -851,3 +864,6 @@ using SmallString = BasicSmallString<31>;
using PathString = BasicSmallString<191>;
} // namespace Utils
#pragma pop_macro("noexcept")
#pragma pop_macro("constexpr")
......@@ -28,6 +28,11 @@
#include <cstddef>
#include <iterator>
#pragma push_macro("noexcept")
#ifndef __cpp_noexcept
#define noexcept
#endif
namespace Utils {
namespace Internal {
......@@ -146,3 +151,5 @@ private:
} // namespace Internal
} // namespace Utils
#pragma pop_macro("noexcept")
......@@ -29,6 +29,22 @@
#include <cstdint>
#pragma push_macro("constexpr")
#ifndef __cpp_constexpr
#define constexpr
#endif
#pragma push_macro("noexcept")
#ifndef __cpp_noexcept
#define noexcept
#endif
#ifdef __cpp_alignas
#define ALIGNAS_16 alignas(16)
#else
#define ALIGNAS_16
#endif
namespace Utils {
namespace Internal {
......@@ -70,7 +86,7 @@ struct ShortStringLayout {
};
template <uint MaximumShortStringDataAreaSize>
struct alignas(16) StringDataLayout {
struct ALIGNAS_16 StringDataLayout {
static_assert( MaximumShortStringDataAreaSize >= 15, "Size must be greater equal than 15 bytes!");
static_assert(((MaximumShortStringDataAreaSize + 1) % 16) == 0, "Size + 1 must be dividable by 16!");
StringDataLayout() noexcept = default;
......@@ -120,3 +136,6 @@ struct alignas(16) StringDataLayout {
} // namespace Internal
} // namespace Utils
#pragma pop_macro("noexcept")
#pragma pop_macro("constexpr")
......@@ -29,6 +29,16 @@
#include "smallstringlayout.h"
#include "smallstringview.h"
#pragma push_macro("constexpr")
#ifndef __cpp_constexpr
#define constexpr
#endif
#pragma push_macro("noexcept")
#ifndef __cpp_noexcept
#define noexcept
#endif
namespace Utils {
template <int Size>
......@@ -119,3 +129,6 @@ private:
using SmallStringLiteral = BasicSmallStringLiteral<31>;
} // namespace Utils
#pragma pop_macro("noexcept")
#pragma pop_macro("constexpr")
......@@ -33,6 +33,11 @@
#include <QStringList>
#pragma push_macro("noexcept")
#ifndef __cpp_noexcept
#define noexcept
#endif
namespace Utils {
template<uint SmallStringSize>
......@@ -155,3 +160,5 @@ private:
using SmallStringVector = BasicSmallStringVector<31>;
using PathStringVector = BasicSmallStringVector<191>;
} // namespace Utils;
#pragma pop_macro("noexcept")
......@@ -31,6 +31,16 @@
#include <cstring>
#pragma push_macro("constexpr")
#ifndef __cpp_constexpr
#define constexpr
#endif
#pragma push_macro("noexcept")
#ifndef __cpp_noexcept
#define noexcept
#endif
namespace Utils {
class SmallStringView
......@@ -125,3 +135,6 @@ bool operator!=(const SmallStringView& first, const SmallStringView& second) noe
}
} // namespace Utils
#pragma pop_macro("noexcept")
#pragma pop_macro("constexpr")
......@@ -29,6 +29,10 @@
#include <utils/smallstringvector.h>
#ifndef __cpp_constexpr
#define constexpr
#endif
namespace {
Utils::SmallStringView createText(int size)
......
......@@ -31,6 +31,10 @@
#include <utils/smallstringio.h>
#include <utils/smallstringvector.h>
#ifndef __cpp_constexpr
#define constexpr
#endif
using namespace ::testing;
using Utils::SmallString;
......
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