From 87290af774d043b34e0f10eec0d85ea5d6c97123 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 9 Jul 2004 04:53:39 +0000 Subject: [PATCH] workaround for broken gcc that ships with SuSE 9.0 and SuSE 9.1 [SVN r23411] --- .../python/detail/translate_exception.hpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/boost/python/detail/translate_exception.hpp b/include/boost/python/detail/translate_exception.hpp index 62f931a5..ced11ebb 100644 --- a/include/boost/python/detail/translate_exception.hpp +++ b/include/boost/python/detail/translate_exception.hpp @@ -22,9 +22,20 @@ namespace boost { namespace python { namespace detail { template struct translate_exception { +// workaround for broken gcc that ships with SuSE 9.0 and SuSE 9.1 +# if defined(__linux__) && defined(__GNUC__) \ + && BOOST_WORKAROUND(__GNUC__, == 3) \ + && BOOST_WORKAROUND(__GNUC_MINOR__, == 3) \ + && (BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 1) \ + || BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 3)) + typedef typename remove_reference< + typename add_const::type + >::type exception_non_ref; +# else typedef typename add_reference< typename add_const::type >::type exception_cref; +# endif inline bool operator()( exception_handler const& handler @@ -35,7 +46,16 @@ struct translate_exception { return handler(f); } +// workaround for broken gcc that ships with SuSE 9.0 and SuSE 9.1 +# if defined(__linux__) && defined(__GNUC__) \ + && BOOST_WORKAROUND(__GNUC__, == 3) \ + && BOOST_WORKAROUND(__GNUC_MINOR__, == 3) \ + && (BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 1) \ + || BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 3)) + catch(exception_non_ref& e) +# else catch(exception_cref e) +# endif { translate(e); return true;