fix compilation and warnings with fcc 4.0.1

This commit is contained in:
Gael Guennebaud 2010-10-13 10:21:28 +02:00
parent bf402dd9b8
commit 3a2bb7f782
2 changed files with 8 additions and 6 deletions

View File

@ -160,7 +160,7 @@
#define EIGEN_ALWAYS_INLINE_ATTRIB #define EIGEN_ALWAYS_INLINE_ATTRIB
#endif #endif
#if EIGEN_GNUC_AT_LEAST(4,0) #if EIGEN_GNUC_AT_LEAST(4,1)
#define EIGEN_FLATTEN_ATTRIB __attribute__((flatten)) #define EIGEN_FLATTEN_ATTRIB __attribute__((flatten))
#else #else
#define EIGEN_FLATTEN_ATTRIB #define EIGEN_FLATTEN_ATTRIB

View File

@ -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 { namespace std {
#define EIGEN_STD_VECTOR_SPECIALIZATION_BODY \ #define EIGEN_STD_VECTOR_SPECIALIZATION_BODY \
@ -119,6 +116,13 @@ namespace std {
{ return vector_base::insert(position,x); } { return vector_base::insert(position,x); }
void insert(const_iterator position, size_type new_size, const value_type& x) void insert(const_iterator position, size_type new_size, const value_type& x)
{ vector_base::insert(position, new_size, 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) #elif defined(_GLIBCXX_VECTOR) && EIGEN_GNUC_AT_LEAST(4,2)
// workaround GCC std::vector implementation // workaround GCC std::vector implementation
void resize(size_type new_size, const value_type& x) 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 #endif // EIGEN_STDVECTOR_H