epoc32/include/stdapis/boost/detail/no_exceptions_support.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/detail/no_exceptions_support.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,87 @@
     1.4 +#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
     1.5 +#define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
     1.6 +
     1.7 +#if (defined _MSC_VER) && (_MSC_VER >= 1200)
     1.8 +#  pragma once
     1.9 +#endif
    1.10 +
    1.11 +//----------------------------------------------------------------------
    1.12 +// (C) Copyright 2004 Pavel Vozenilek.
    1.13 +// Use, modification and distribution is subject to the Boost Software
    1.14 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt
    1.15 +// or copy at http://www.boost.org/LICENSE_1_0.txt)
    1.16 +//
    1.17 +//
    1.18 +// This file contains helper macros used when exception support may be
    1.19 +// disabled (as indicated by macro BOOST_NO_EXCEPTIONS).
    1.20 +//
    1.21 +// Before picking up these macros you may consider using RAII techniques
    1.22 +// to deal with exceptions - their syntax can be always the same with 
    1.23 +// or without exception support enabled.
    1.24 +//
    1.25 +
    1.26 +/* Example of use:
    1.27 +
    1.28 +void foo() {
    1.29 +  BOOST_TRY {
    1.30 +    ...
    1.31 +  } BOOST_CATCH(const std::bad_alloc&) {
    1.32 +      ...
    1.33 +      BOOST_RETHROW
    1.34 +  } BOOST_CATCH(const std::exception& e) {
    1.35 +      ...
    1.36 +  }
    1.37 +  BOOST_CATCH_END
    1.38 +}
    1.39 +
    1.40 +With exception support enabled it will expand into:
    1.41 +
    1.42 +void foo() {
    1.43 +  { try {
    1.44 +    ...
    1.45 +  } catch (const std::bad_alloc&) {
    1.46 +      ...
    1.47 +      throw;
    1.48 +  } catch (const std::exception& e) {
    1.49 +      ...
    1.50 +  }
    1.51 +  }
    1.52 +}
    1.53 +
    1.54 +With exception support disabled it will expand into:
    1.55 +
    1.56 +void foo() {
    1.57 +  { if(true) {
    1.58 +    ...
    1.59 +  } else if (false) {
    1.60 +      ...
    1.61 +  } else if (false)  {
    1.62 +      ...
    1.63 +  }
    1.64 +  }
    1.65 +}
    1.66 +*/
    1.67 +//----------------------------------------------------------------------
    1.68 +
    1.69 +#include <boost/config.hpp>
    1.70 +#include <boost/detail/workaround.hpp>
    1.71 +
    1.72 +#if !(defined BOOST_NO_EXCEPTIONS)
    1.73 +#    define BOOST_TRY { try
    1.74 +#    define BOOST_CATCH(x) catch(x)
    1.75 +#    define BOOST_RETHROW throw;
    1.76 +#    define BOOST_CATCH_END }
    1.77 +#else
    1.78 +#    if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
    1.79 +#        define BOOST_TRY { if ("")
    1.80 +#        define BOOST_CATCH(x) else if (!"")
    1.81 +#    else
    1.82 +#        define BOOST_TRY { if (true)
    1.83 +#        define BOOST_CATCH(x) else if (false)
    1.84 +#    endif
    1.85 +#    define BOOST_RETHROW
    1.86 +#    define BOOST_CATCH_END }
    1.87 +#endif
    1.88 +
    1.89 +
    1.90 +#endif