summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qcompilerdetection.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2019-10-21 15:27:04 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2019-10-29 10:37:09 +0100
commit3ea6a13a01f513ab491f698109fdf189e6264203 (patch)
tree27548766ee6714e0bb3c78399b066cbf9d67628d /src/corelib/global/qcompilerdetection.h
parent226a60baf50c9c91a98c01c3dd9c0ced750f8d0e (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qcompilerdetection.h')
-rw-r--r--src/corelib/global/qcompilerdetection.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index b173dcf522..ad3d2be69b 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -91,7 +91,6 @@
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_COMPILER_MANGLES_RETURN_TYPE
# define Q_FUNC_INFO __FUNCSIG__
-# define Q_DECL_ALIGN(n) __declspec(align(n))
# define Q_ASSUME_IMPL(expr) __assume(expr)
# define Q_UNREACHABLE_IMPL() __assume(0)
# define Q_NORETURN __declspec(noreturn)
@@ -223,7 +222,6 @@
# define Q_FUNC_INFO __PRETTY_FUNCTION__
# define Q_TYPEOF(expr) __typeof__(expr)
# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
-# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# define Q_DECL_UNUSED __attribute__((__unused__))
# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
@@ -271,7 +269,6 @@
# error "Compiler not supported"
# elif __xlC__ >= 0x0600
# define Q_TYPEOF(expr) __typeof__(expr)
-# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# define Q_PACKED __attribute__((__packed__))
# endif
@@ -447,7 +444,6 @@
/* see http://developers.sun.com/sunstudio/support/Ccompare.html */
# if __SUNPRO_CC >= 0x590
# define Q_TYPEOF(expr) __typeof__(expr)
-# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# endif
# if __SUNPRO_CC >= 0x550
# define Q_DECL_EXPORT __global
@@ -484,9 +480,6 @@
# define Q_DECL_EXPORT __declspec(dllexport)
# define Q_DECL_IMPORT __declspec(dllimport)
# endif
-# if __HP_aCC-0 >= 061200
-# define Q_DECL_ALIGN(n) __attribute__((aligned(n)))
-# endif
# if __HP_aCC-0 >= 062000
# define Q_DECL_EXPORT __attribute__((visibility("default")))
# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
@@ -1127,9 +1120,8 @@
# define Q_ALIGNOF(x) alignof(x)
#endif
-#if defined(Q_COMPILER_ALIGNAS)
-# undef Q_DECL_ALIGN
-# define Q_DECL_ALIGN(n) alignas(n)
+#ifndef Q_DECL_ALIGN
+# define Q_DECL_ALIGN(n) alignas(n)
#endif
#if QT_HAS_CPP_ATTRIBUTE(nodiscard) && !defined(Q_CC_CLANG) // P0188R1