This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
View | Details | Raw Unified | Return to bug 89 | Differences between
and this patch

Collapse All | Expand All

(-)a/Eigen/src/Core/util/Macros.h (-1 / +7 lines)
Lines 29-49 Link Here
29
#define EIGEN_WORLD_VERSION 2
29
#define EIGEN_WORLD_VERSION 2
30
#define EIGEN_MAJOR_VERSION 93
30
#define EIGEN_MAJOR_VERSION 93
31
#define EIGEN_MINOR_VERSION 0
31
#define EIGEN_MINOR_VERSION 0
32
32
33
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
33
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
34
                                      (EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
34
                                      (EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
35
                                                                 EIGEN_MINOR_VERSION>=z))))
35
                                                                 EIGEN_MINOR_VERSION>=z))))
36
#ifdef __GNUC__
36
#ifdef __GNUC__
37
  #define EIGEN_GNUC_AT_LEAST(x,y) ((__GNUC__>=x && __GNUC_MINOR__>=y) || __GNUC__>x)
37
  #define EIGEN_GNUC_AT_LEAST(x,y) ((__GNUC__==x && __GNUC_MINOR__>=y) || __GNUC__>x)
38
#else
38
#else
39
  #define EIGEN_GNUC_AT_LEAST(x,y) 0
39
  #define EIGEN_GNUC_AT_LEAST(x,y) 0
40
#endif
40
#endif
41
41
42
#ifdef __GNUC__
43
  #define EIGEN_GNUC_AT_MOST(x,y) ((__GNUC__==x && __GNUC_MINOR__<=y) || __GNUC__<x)
44
#else
45
  #define EIGEN_GNUC_AT_MOST(x,y) 0
46
#endif
47
42
#if defined(__GNUC__) && (__GNUC__ <= 3)
48
#if defined(__GNUC__) && (__GNUC__ <= 3)
43
#define EIGEN_GCC3_OR_OLDER 1
49
#define EIGEN_GCC3_OR_OLDER 1
44
#else
50
#else
45
#define EIGEN_GCC3_OR_OLDER 0
51
#define EIGEN_GCC3_OR_OLDER 0
46
#endif
52
#endif
47
53
48
// 16 byte alignment is only useful for vectorization. Since it affects the ABI, we need to enable
54
// 16 byte alignment is only useful for vectorization. Since it affects the ABI, we need to enable
49
// 16 byte alignment on all platforms where vectorization might be enabled. In theory we could always
55
// 16 byte alignment on all platforms where vectorization might be enabled. In theory we could always
(-)a/test/main.h (-7 / +21 lines)
Lines 125-147 namespace Eigen Link Here
125
          Eigen::internal::push_assert = false; VERIFY(true);                                \
125
          Eigen::internal::push_assert = false; VERIFY(true);                                \
126
        }                                                                             \
126
        }                                                                             \
127
        Eigen::report_on_cerr_on_assert_failure = true;                               \
127
        Eigen::report_on_cerr_on_assert_failure = true;                               \
128
        Eigen::internal::push_assert = false;                                                \
128
        Eigen::internal::push_assert = false;                                                \
129
      }
129
      }
130
130
131
  #else // EIGEN_DEBUG_ASSERTS
131
  #else // EIGEN_DEBUG_ASSERTS
132
132
133
    #define eigen_assert(a) \
133
    #ifdef __GNUC__
134
      if( (!(a)) && (!no_more_assert) )       \
134
      #define EIGEN_TEST_GNUC_AT_MOST(x,y) ((__GNUC__==x && __GNUC_MINOR__<=y) || __GNUC__<x)
135
      {                                       \
135
    #else
136
        Eigen::no_more_assert = true;         \
136
      #define EIGEN_TEST_GNUC_AT_MOST(x,y) 0
137
        if(report_on_cerr_on_assert_failure)  \
137
    #endif
138
          assert(a);                          \
138
139
        else                                  \
139
    #if EIGEN_TEST_GNUC_AT_MOST(4,3) // work around bug 89
140
      #define eigen_assert_work_around_gcc_bug(a) \
141
       do { std::cerr <<  #a << " " __FILE__ << "(" << __LINE__ << ")\n"; \
142
            abort(); } while(0)
143
    #else
144
      #define eigen_assert_work_around_gcc_bug(a) assert(a)
145
    #endif
146
147
    #define eigen_assert(a)                      \
148
      if( (!(a)) && (!no_more_assert) )          \
149
      {                                          \
150
        Eigen::no_more_assert = true;            \
151
        if(report_on_cerr_on_assert_failure)     \
152
          eigen_assert_work_around_gcc_bug(a);   \
153
        else                                     \
140
          throw Eigen::eigen_assert_exception(); \
154
          throw Eigen::eigen_assert_exception(); \
141
      }
155
      }
142
156
143
    #define VERIFY_RAISES_ASSERT(a) {                             \
157
    #define VERIFY_RAISES_ASSERT(a) {                             \
144
        Eigen::no_more_assert = false;                            \
158
        Eigen::no_more_assert = false;                            \
145
        Eigen::report_on_cerr_on_assert_failure = false;          \
159
        Eigen::report_on_cerr_on_assert_failure = false;          \
146
        try {                                                     \
160
        try {                                                     \
147
          a;                                                      \
161
          a;                                                      \

Return to bug 89