Commit eeb0b8fd authored by Robert Loehning's avatar Robert Loehning

Revert "Revert "Utils: Remove old compiler support code""

Thomas provided a smaller fix.
This reverts commit 78fb7f44.

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