From 9005f0111f3b5f4d29939ee67a5b516b0585455f Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 11 Jan 2019 17:10:54 +0100 Subject: Replace compiler's alignas/alignof extension by respective c++11 keywords when available. This also fix a compilation issue with gcc-4.7. --- .../Core/arch/Default/GenericPacketMathFunctions.h | 4 -- Eigen/src/Core/util/ConfigureVectorization.h | 7 +++- Eigen/src/Core/util/Macros.h | 43 ++++++++++++++++++---- 3 files changed, 42 insertions(+), 12 deletions(-) (limited to 'Eigen/src') diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 8c6e4f5c7..9a902c82d 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h @@ -340,11 +340,7 @@ Packet psincos_float(const Packet& _x) if(predux_any(huge_mask)) { const int PacketSize = unpacket_traits::size; - #if EIGEN_HAS_CXX11 - alignas(Packet) float vals[PacketSize]; - #else EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float vals[PacketSize]; - #endif pstoreu(vals, _x); for(int k=0; k=11 && EIGEN_HAS_CXX11 && \ + ( __has_feature(cxx_alignas) \ + || EIGEN_HAS_CXX14 \ + || (EIGEN_COMP_MSVC >= 1800) \ + || (EIGEN_GNUC_AT_LEAST(4,8)) \ + || (EIGEN_COMP_CLANG>=305) \ + || (EIGEN_COMP_ICC>=1500) \ + || (EIGEN_COMP_PGI>=1500) \ + || (EIGEN_COMP_SUN>=0x5130)) +#define EIGEN_HAS_ALIGNAS 1 +#else +#define EIGEN_HAS_ALIGNAS 0 +#endif +#endif + // Does the compiler support type_traits? // - full support of type traits was added only to GCC 5.1.0. // - 20150626 corresponds to the last release of 4.x libstdc++ -- cgit v1.2.3