bug #1237: Redefine eigen_assert instead of disabling assertions for documentation snippets

This commit is contained in:
Christoph Hertzberg 2016-05-26 18:13:33 +02:00
parent 7ff5fadcc0
commit 41dcd047d7
2 changed files with 4 additions and 4 deletions

View File

@ -24,6 +24,3 @@ foreach(snippet_src ${snippets_SRCS})
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src} set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}
PROPERTIES OBJECT_DEPENDS ${snippet_src}) PROPERTIES OBJECT_DEPENDS ${snippet_src})
endforeach(snippet_src) endforeach(snippet_src)
ei_add_target_property(compile_tut_arithmetic_transpose_aliasing COMPILE_FLAGS -DEIGEN_NO_DEBUG)
ei_add_target_property(compile_TopicAliasing_mult4 COMPILE_FLAGS -DEIGEN_NO_DEBUG) # workaroud for Bug 1237

View File

@ -1,5 +1,8 @@
#include <Eigen/Eigen> static bool eigen_did_assert = false;
#define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;}
#include <iostream> #include <iostream>
#include <Eigen/Eigen>
#ifndef M_PI #ifndef M_PI
#define M_PI 3.1415926535897932384626433832795 #define M_PI 3.1415926535897932384626433832795