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