~tsarev/boostdc/cmake

« back to all changes in this revision

Viewing changes to boost/boost/detail/no_exceptions_support.hpp

  • Committer: bigmuscle
  • Date: 2010-05-08 08:47:15 UTC
  • Revision ID: svn-v4:5fb55d53-692c-0410-a46a-e90ab66e00ee:trunk:497
removed old boost version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
2
 
#define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
3
 
 
4
 
#if (defined _MSC_VER) && (_MSC_VER >= 1200)
5
 
#  pragma once
6
 
#endif
7
 
 
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)
13
 
//
14
 
//
15
 
// This file contains helper macros used when exception support may be
16
 
// disabled (as indicated by macro BOOST_NO_EXCEPTIONS).
17
 
//
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.
21
 
//
22
 
 
23
 
/* Example of use:
24
 
 
25
 
void foo() {
26
 
  BOOST_TRY {
27
 
    ...
28
 
  } BOOST_CATCH(const std::bad_alloc&) {
29
 
      ...
30
 
      BOOST_RETHROW
31
 
  } BOOST_CATCH(const std::exception& e) {
32
 
      ...
33
 
  }
34
 
  BOOST_CATCH_END
35
 
}
36
 
 
37
 
With exception support enabled it will expand into:
38
 
 
39
 
void foo() {
40
 
  { try {
41
 
    ...
42
 
  } catch (const std::bad_alloc&) {
43
 
      ...
44
 
      throw;
45
 
  } catch (const std::exception& e) {
46
 
      ...
47
 
  }
48
 
  }
49
 
}
50
 
 
51
 
With exception support disabled it will expand into:
52
 
 
53
 
void foo() {
54
 
  { if(true) {
55
 
    ...
56
 
  } else if (false) {
57
 
      ...
58
 
  } else if (false)  {
59
 
      ...
60
 
  }
61
 
  }
62
 
}
63
 
*/
64
 
//----------------------------------------------------------------------
65
 
 
66
 
#include <boost/config.hpp>
67
 
#include <boost/detail/workaround.hpp>
68
 
 
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 }
74
 
#else
75
 
#    if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
76
 
#        define BOOST_TRY { if ("")
77
 
#        define BOOST_CATCH(x) else if (!"")
78
 
#    else
79
 
#        define BOOST_TRY { if (true)
80
 
#        define BOOST_CATCH(x) else if (false)
81
 
#    endif
82
 
#    define BOOST_RETHROW
83
 
#    define BOOST_CATCH_END }
84
 
#endif
85
 
 
86
 
 
87
 
#endif