diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-10-13 10:21:28 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-10-13 10:21:28 +0200 |
commit | 3a2bb7f78256df94f4b53e87f1b9d203965b1e4d (patch) | |
tree | 77ca60bc076659efcbaab8fa6a8c9281024300cf /Eigen | |
parent | bf402dd9b86290a654bdc47a706ad4b9ccc56d4d (diff) |
fix compilation and warnings with fcc 4.0.1
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/util/Macros.h | 2 | ||||
-rw-r--r-- | Eigen/src/StlSupport/StdVector.h | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 319c6c5fc..e8e3a44ab 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -160,7 +160,7 @@ #define EIGEN_ALWAYS_INLINE_ATTRIB #endif -#if EIGEN_GNUC_AT_LEAST(4,0) +#if EIGEN_GNUC_AT_LEAST(4,1) #define EIGEN_FLATTEN_ATTRIB __attribute__((flatten)) #else #define EIGEN_FLATTEN_ATTRIB diff --git a/Eigen/src/StlSupport/StdVector.h b/Eigen/src/StlSupport/StdVector.h index 9786bac34..81a2d7762 100644 --- a/Eigen/src/StlSupport/StdVector.h +++ b/Eigen/src/StlSupport/StdVector.h @@ -67,9 +67,6 @@ namespace std \ }; \ } -// check whether we really need the std::vector specialization -#if !(defined(_GLIBCXX_VECTOR) && (!EIGEN_GNUC_AT_LEAST(4,1))) /* Note that before gcc-4.1 we already have: std::vector::resize(size_type,const T&). */ - namespace std { #define EIGEN_STD_VECTOR_SPECIALIZATION_BODY \ @@ -119,6 +116,13 @@ namespace std { { return vector_base::insert(position,x); } void insert(const_iterator position, size_type new_size, const value_type& x) { vector_base::insert(position, new_size, x); } +#elif defined(_GLIBCXX_VECTOR) && (!(EIGEN_GNUC_AT_LEAST(4,1))) + /* Note that before gcc-4.1 we already have: std::vector::resize(size_type,const T&). + * However, this specialization is still needed to make the above EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION trick to work. */ + void resize(size_type new_size, const value_type& x) + { + vector_base::resize(new_size,x); + } #elif defined(_GLIBCXX_VECTOR) && EIGEN_GNUC_AT_LEAST(4,2) // workaround GCC std::vector implementation void resize(size_type new_size, const value_type& x) @@ -142,6 +146,4 @@ namespace std { }; } -#endif // check whether specialization is actually required - #endif // EIGEN_STDVECTOR_H |