aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/smallstringlayout.h
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2017-01-30 14:07:29 +0100
committerTim Jenssen <tim.jenssen@qt.io>2017-01-30 14:32:47 +0000
commit1dd407736a95fe5dfe982170f48b1e6cd74a8b32 (patch)
tree967813f1c70c967cb3053b9480a9cc1c29da64cd /src/libs/utils/smallstringlayout.h
parentc072cdfb8876df773da11222a35b7062dee2ad29 (diff)
Utils: compile work around for MSVC 2015 update 3
Seems to be a compiler bug and can be removed if fixed in the compiler. Change-Id: I5c1aad3b135298ced0a9b706f2aab483b04abc56 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/libs/utils/smallstringlayout.h')
-rw-r--r--src/libs/utils/smallstringlayout.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/utils/smallstringlayout.h b/src/libs/utils/smallstringlayout.h
index 7fcaefd0078..12f63f99fdf 100644
--- a/src/libs/utils/smallstringlayout.h
+++ b/src/libs/utils/smallstringlayout.h
@@ -29,6 +29,12 @@
#include <cstdint>
+#ifdef Q_CC_MSVC
+# define ALIGNAS_16
+#elif
+# define ALIGNAS_16 alignas(16)
+#endif
+
namespace Utils {
namespace Internal {
@@ -70,7 +76,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;