From 27e7fd18f1c337c409f2a567697b27bcd0c09f8b Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Wed, 7 Jul 2021 17:12:12 -0400 Subject: Support manually disabling exceptions Rename EIGEN_EXCEPTIONS to EIGEN_USE_EXCEPTIONS, and allow disabling exceptions with -DEIGEN_USE_EXCEPTIONS=0. --- unsupported/test/cxx11_maxsizevector.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'unsupported/test/cxx11_maxsizevector.cpp') diff --git a/unsupported/test/cxx11_maxsizevector.cpp b/unsupported/test/cxx11_maxsizevector.cpp index 46b689a8e..24064c4ee 100644 --- a/unsupported/test/cxx11_maxsizevector.cpp +++ b/unsupported/test/cxx11_maxsizevector.cpp @@ -12,7 +12,7 @@ struct Foo Foo(int x=0) : dummy(x) { -#ifdef EIGEN_EXCEPTIONS +#if EIGEN_USE_EXCEPTIONS // TODO: Is this the correct way to handle this? if (Foo::object_count > Foo::object_limit) { std::cout << "\nThrow!\n"; throw Foo::Fail(); } #endif @@ -50,17 +50,17 @@ EIGEN_DECLARE_TEST(cxx11_maxsizevector) Foo::object_limit = internal::random(0, rows - 2); std::cout << "object_limit = " << Foo::object_limit << std::endl; bool exception_raised = false; -#ifdef EIGEN_EXCEPTIONS - try + EIGEN_TRY { -#endif std::cout << "\nVectorX m(" << rows << ");\n"; VectorX vect(rows); for(int i=0; i