1 #ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
\r
2 #define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
\r
4 #if (defined _MSC_VER) && (_MSC_VER >= 1200)
\r
8 //----------------------------------------------------------------------
\r
9 // (C) Copyright 2004 Pavel Vozenilek.
\r
10 // Use, modification and distribution is subject to the Boost Software
\r
11 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt
\r
12 // or copy at http://www.boost.org/LICENSE_1_0.txt)
\r
15 // This file contains helper macros used when exception support may be
\r
16 // disabled (as indicated by macro BOOST_NO_EXCEPTIONS).
\r
18 // Before picking up these macros you may consider using RAII techniques
\r
19 // to deal with exceptions - their syntax can be always the same with
\r
20 // or without exception support enabled.
\r
28 } BOOST_CATCH(const std::bad_alloc&) {
\r
31 } BOOST_CATCH(const std::exception& e) {
\r
37 With exception support enabled it will expand into:
\r
42 } catch (const std::bad_alloc&) {
\r
45 } catch (const std::exception& e) {
\r
51 With exception support disabled it will expand into:
\r
64 //----------------------------------------------------------------------
\r
66 #include <boost/config.hpp>
\r
67 #include <boost/detail/workaround.hpp>
\r
69 #if !(defined BOOST_NO_EXCEPTIONS)
\r
70 # define BOOST_TRY { try
\r
71 # define BOOST_CATCH(x) catch(x)
\r
72 # define BOOST_RETHROW throw;
\r
73 # define BOOST_CATCH_END }
\r
75 # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
\r
76 # define BOOST_TRY { if ("")
\r
77 # define BOOST_CATCH(x) else if (!"")
\r
79 # define BOOST_TRY { if (true)
\r
80 # define BOOST_CATCH(x) else if (false)
\r
82 # define BOOST_RETHROW
\r
83 # define BOOST_CATCH_END }
\r