diff --git a/Eigen/Core b/Eigen/Core index 8567e294c..29b3a2ac1 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -156,9 +156,13 @@ // for min/max: #include +#if !EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO +#include // for custom assert implementation +#endif + // for outputting debug info #ifdef EIGEN_DEBUG_ASSIGN -#include +#include #endif // required for __cpuid, needs to be included after cmath diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 6a30f6bed..020cf2cb7 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -34,10 +34,23 @@ (EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \ EIGEN_MINOR_VERSION>=z)))) #ifdef __GNUC__ - #define EIGEN_GNUC_AT_LEAST(x,y) ((__GNUC__>=x && __GNUC_MINOR__>=y) || __GNUC__>x) + #define EIGEN_GNUC_AT_LEAST(x,y) ((__GNUC__==x && __GNUC_MINOR__>=y) || __GNUC__>x) #else #define EIGEN_GNUC_AT_LEAST(x,y) 0 #endif + +#ifdef __GNUC__ + #define EIGEN_GNUC_AT_MOST(x,y) ((__GNUC__==x && __GNUC_MINOR__<=y) || __GNUC__ eigen_assert_list; } - #define eigen_assert(a) \ if( (!(a)) && (!no_more_assert) ) \ { \ @@ -129,17 +127,16 @@ namespace Eigen } #else // EIGEN_DEBUG_ASSERTS - + // see bug 89. The copy_bool here is working around a bug in gcc <= 4.3 #define eigen_assert(a) \ - if( (!(a)) && (!no_more_assert) ) \ + if( (!Eigen::internal::copy_bool(a)) && (!no_more_assert) )\ { \ Eigen::no_more_assert = true; \ if(report_on_cerr_on_assert_failure) \ - assert(a); \ + eigen_plain_assert(a); \ else \ throw Eigen::eigen_assert_exception(); \ } - #define VERIFY_RAISES_ASSERT(a) { \ Eigen::no_more_assert = false; \ Eigen::report_on_cerr_on_assert_failure = false; \ @@ -165,7 +162,6 @@ namespace Eigen #define EIGEN_INTERNAL_DEBUGGING #include // required for createRandomPIMatrixOfRank - static void verify_impl(bool condition, const char *testname, const char *file, int line, const char *condition_as_string) { if (!condition) @@ -176,7 +172,8 @@ static void verify_impl(bool condition, const char *testname, const char *file, } } -#define VERIFY(a) verify_impl(a, g_test_stack.back().c_str(), __FILE__, __LINE__, EI_PP_MAKE_STRING(a)) +#define VERIFY(a) assert(a) +//#define VERIFY(a) verify_impl(a, g_test_stack.back().c_str(), __FILE__, __LINE__, EI_PP_MAKE_STRING(a)) #define VERIFY_IS_EQUAL(a, b) VERIFY(test_is_equal(a, b)) #define VERIFY_IS_APPROX(a, b) VERIFY(test_isApprox(a, b))