From 3ea6a13a01f513ab491f698109fdf189e6264203 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 21 Oct 2019 15:27:04 +0200 Subject: Replace usage of Q_DECL_ALIGN with C++11 alignas keyword The macro is not documented, so can be considered private API. Pre-C++11 compilers that don't support alignas will no longer be supported with Qt 6. The macro definition for the standard case of compilers supporting the alignof keyword is left in place. Task-number: QTBUG-76414 Change-Id: I7d722e4faf09ae998a972d3ed914de808ab316d7 Reviewed-by: Thiago Macieira --- src/corelib/global/qrandom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/global/qrandom.cpp') diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index 3cbd40b772..563e5eb7ed 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -355,7 +355,7 @@ struct QRandomGenerator::SystemAndGlobalGenerators // the state in case another thread tries to lock the mutex. It's not // a common scenario, but since sizeof(QRandomGenerator) >= 2560, the // overhead is actually acceptable. - // 2) We use both Q_DECL_ALIGN and std::aligned_storage<..., 64> because + // 2) We use both alignas and std::aligned_storage<..., 64> because // some implementations of std::aligned_storage can't align to more // than a primitive type's alignment. // 3) We don't store the entire system QRandomGenerator, only the space @@ -364,7 +364,7 @@ struct QRandomGenerator::SystemAndGlobalGenerators QBasicMutex globalPRNGMutex; struct ShortenedSystem { uint type; } system_; SystemGenerator sys; - Q_DECL_ALIGN(64) std::aligned_storage::type global_; + alignas(64) std::aligned_storage::type global_; #ifdef Q_COMPILER_CONSTEXPR constexpr SystemAndGlobalGenerators() -- cgit v1.2.3