From 71f023de3e7a41f456d538d4cdb75c72b90dcc75 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 27 Sep 2010 09:57:57 -0400 Subject: [PATCH] fix compilation on ubuntu 9.04's version of gcc 4.3 (yes, wtf) --- Eigen/Core | 2 ++ Eigen/src/Core/MatrixBase.h | 12 ++++++++---- Eigen/src/Core/VectorwiseOp.h | 4 ++-- Eigen/src/Core/util/StaticAssert.h | 4 ++-- Eigen/src/Geometry/Homogeneous.h | 8 ++++---- Eigen/src/Geometry/Scaling.h | 2 +- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Eigen/Core b/Eigen/Core index 56005f836..491e0ab63 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -26,6 +26,8 @@ #ifndef EIGEN_CORE_H #define EIGEN_CORE_H +#define EIGEN_NO_STATIC_ASSERT + // first thing Eigen does: prevent MSVC from committing suicide #include "src/Core/util/DisableMSVCWarnings.h" diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index c186730be..2765db5b3 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -341,7 +341,7 @@ template class MatrixBase PlainObject cross3(const MatrixBase& other) const; PlainObject unitOrthogonal(void) const; Matrix eulerAngles(Index a0, Index a1, Index a2) const; - const ScalarMultipleReturnType operator*(const UniformScaling& s) const; + ScalarMultipleReturnType operator*(const UniformScaling& s) const; enum { SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1 }; @@ -351,9 +351,13 @@ template class MatrixBase typedef CwiseUnaryOp::Scalar>, StartMinusOne > HNormalizedReturnType; - const HNormalizedReturnType hnormalized() const; - typedef Homogeneous::ColsAtCompileTime==1?Vertical:Horizontal> HomogeneousReturnType; - const HomogeneousReturnType homogeneous() const; + HNormalizedReturnType hnormalized() const; + + // put this as separate enum value to work around possible GCC 4.3 bug (?) + enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1?Vertical:Horizontal }; + typedef Homogeneous HomogeneousReturnType; + + HomogeneousReturnType homogeneous() const; ////////// Householder module /////////// diff --git a/Eigen/src/Core/VectorwiseOp.h b/Eigen/src/Core/VectorwiseOp.h index c9cb8e820..7f7ab842e 100644 --- a/Eigen/src/Core/VectorwiseOp.h +++ b/Eigen/src/Core/VectorwiseOp.h @@ -463,7 +463,7 @@ template class VectorwiseOp /////////// Geometry module /////////// - const Homogeneous homogeneous() const; + Homogeneous homogeneous() const; typedef typename ExpressionType::PlainObject CrossReturnType; template @@ -491,7 +491,7 @@ template class VectorwiseOp Direction==Horizontal ? HNormalized_SizeMinusOne : 1> > HNormalizedReturnType; - const HNormalizedReturnType hnormalized() const; + HNormalizedReturnType hnormalized() const; protected: ExpressionTypeNested m_matrix; diff --git a/Eigen/src/Core/util/StaticAssert.h b/Eigen/src/Core/util/StaticAssert.h index eb7f3ef50..323273e6a 100644 --- a/Eigen/src/Core/util/StaticAssert.h +++ b/Eigen/src/Core/util/StaticAssert.h @@ -100,12 +100,12 @@ #ifdef _MSC_VER #define EIGEN_STATIC_ASSERT(CONDITION,MSG) \ - {Eigen::ei_static_assert::MSG;} + {Eigen::ei_static_assert<(CONDITION)>::MSG;} #else #define EIGEN_STATIC_ASSERT(CONDITION,MSG) \ - if (Eigen::ei_static_assert::MSG) {} + if (Eigen::ei_static_assert<(CONDITION)>::MSG) {} #endif diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h index 5c10e9bcf..f05899dc8 100644 --- a/Eigen/src/Geometry/Homogeneous.h +++ b/Eigen/src/Geometry/Homogeneous.h @@ -143,7 +143,7 @@ template class Homogeneous * \sa class Homogeneous */ template -inline const typename MatrixBase::HomogeneousReturnType +inline typename MatrixBase::HomogeneousReturnType MatrixBase::homogeneous() const { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived); @@ -159,7 +159,7 @@ MatrixBase::homogeneous() const * * \sa MatrixBase::homogeneous() */ template -inline const Homogeneous +inline Homogeneous VectorwiseOp::homogeneous() const { return _expression(); @@ -174,7 +174,7 @@ VectorwiseOp::homogeneous() const * * \sa VectorwiseOp::hnormalized() */ template -inline const typename MatrixBase::HNormalizedReturnType +inline typename MatrixBase::HNormalizedReturnType MatrixBase::hnormalized() const { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived); @@ -192,7 +192,7 @@ MatrixBase::hnormalized() const * * \sa MatrixBase::hnormalized() */ template -inline const typename VectorwiseOp::HNormalizedReturnType +inline typename VectorwiseOp::HNormalizedReturnType VectorwiseOp::hnormalized() const { return HNormalized_Block(_expression(),0,0, diff --git a/Eigen/src/Geometry/Scaling.h b/Eigen/src/Geometry/Scaling.h index 05b3e0526..8fdbdb102 100644 --- a/Eigen/src/Geometry/Scaling.h +++ b/Eigen/src/Geometry/Scaling.h @@ -115,7 +115,7 @@ public: /** Concatenates a linear transformation matrix and a uniform scaling */ // NOTE this operator is defiend in MatrixBase and not as a friend function // of UniformScaling to fix an internal crash of Intel's ICC -template const typename MatrixBase::ScalarMultipleReturnType +template typename MatrixBase::ScalarMultipleReturnType MatrixBase::operator*(const UniformScaling& s) const { return derived() * s.factor(); }