author | Jon Chatten |
Mon, 18 Jan 2010 09:02:25 +0000 | |
branch | fix |
changeset 113 | 3d2908a2186b |
parent 0 | 044383f39525 |
permissions | -rw-r--r-- |
0
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
1 |
// boost/catch_exceptions.hpp -----------------------------------------------// |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
2 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
3 |
// Copyright Beman Dawes 1995-2001. Distributed under the Boost |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
4 |
// Software License, Version 1.0. (See accompanying file |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
5 |
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
6 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
7 |
// See http://www.boost.org/libs/test for documentation. |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
8 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
9 |
// Revision History |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
10 |
// 13 Jun 01 report_exception() made inline. (John Maddock, Jesse Jones) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
11 |
// 26 Feb 01 Numerous changes suggested during formal review. (Beman) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
12 |
// 25 Jan 01 catch_exceptions.hpp code factored out of cpp_main.cpp. |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
13 |
// 22 Jan 01 Remove test_tools dependencies to reduce coupling. |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
14 |
// 5 Nov 00 Initial boost version (Beman Dawes) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
15 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
16 |
#ifndef BOOST_CATCH_EXCEPTIONS_HPP |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
17 |
#define BOOST_CATCH_EXCEPTIONS_HPP |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
18 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
19 |
// header dependencies are deliberately restricted to the standard library |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
20 |
// to reduce coupling to other boost libraries. |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
21 |
#include <string> // for string |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
22 |
#include <new> // for bad_alloc |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
23 |
#include <typeinfo> // for bad_cast, bad_typeid |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
24 |
#include <exception> // for exception, bad_exception |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
25 |
#include <stdexcept> // for std exception hierarchy |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
26 |
#include <boost/cstdlib.hpp> // for exit codes |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
27 |
# if __GNUC__ != 2 || __GNUC_MINOR__ > 96 |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
28 |
# include <ostream> // for ostream |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
29 |
# else |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
30 |
# include <iostream> // workaround GNU missing ostream header |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
31 |
# endif |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
32 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
33 |
# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
34 |
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
35 |
# endif |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
36 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
37 |
#if defined(MPW_CPLUS) && (MPW_CPLUS <= 0x890) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
38 |
# define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
39 |
namespace std { class bad_typeid { }; } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
40 |
# endif |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
41 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
42 |
namespace boost |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
43 |
{ |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
44 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
45 |
namespace detail |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
46 |
{ |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
47 |
// A separate reporting function was requested during formal review. |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
48 |
inline void report_exception( std::ostream & os, |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
49 |
const char * name, const char * info ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
50 |
{ os << "\n** uncaught exception: " << name << " " << info << std::endl; } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
51 |
} |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
52 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
53 |
// catch_exceptions ------------------------------------------------------// |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
54 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
55 |
template< class Generator > // Generator is function object returning int |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
56 |
int catch_exceptions( Generator function_object, |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
57 |
std::ostream & out, std::ostream & err ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
58 |
{ |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
59 |
int result = 0; // quiet compiler warnings |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
60 |
bool exception_thrown = true; // avoid setting result for each excptn type |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
61 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
62 |
#ifndef BOOST_NO_EXCEPTIONS |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
63 |
try |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
64 |
{ |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
65 |
#endif |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
66 |
result = function_object(); |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
67 |
exception_thrown = false; |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
68 |
#ifndef BOOST_NO_EXCEPTIONS |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
69 |
} |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
70 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
71 |
// As a result of hard experience with strangely interleaved output |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
72 |
// under some compilers, there is a lot of use of endl in the code below |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
73 |
// where a simple '\n' might appear to do. |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
74 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
75 |
// The rules for catch & arguments are a bit different from function |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
76 |
// arguments (ISO 15.3 paragraphs 18 & 19). Apparently const isn't |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
77 |
// required, but it doesn't hurt and some programmers ask for it. |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
78 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
79 |
catch ( const char * ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
80 |
{ detail::report_exception( out, "", ex ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
81 |
catch ( const std::string & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
82 |
{ detail::report_exception( out, "", ex.c_str() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
83 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
84 |
// std:: exceptions |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
85 |
catch ( const std::bad_alloc & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
86 |
{ detail::report_exception( out, "std::bad_alloc:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
87 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
88 |
# ifndef BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
89 |
catch ( const std::bad_cast & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
90 |
{ detail::report_exception( out, "std::bad_cast:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
91 |
catch ( const std::bad_typeid & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
92 |
{ detail::report_exception( out, "std::bad_typeid:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
93 |
# else |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
94 |
catch ( const std::bad_cast & ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
95 |
{ detail::report_exception( out, "std::bad_cast", "" ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
96 |
catch ( const std::bad_typeid & ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
97 |
{ detail::report_exception( out, "std::bad_typeid", "" ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
98 |
# endif |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
99 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
100 |
catch ( const std::bad_exception & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
101 |
{ detail::report_exception( out, "std::bad_exception:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
102 |
catch ( const std::domain_error & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
103 |
{ detail::report_exception( out, "std::domain_error:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
104 |
catch ( const std::invalid_argument & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
105 |
{ detail::report_exception( out, "std::invalid_argument:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
106 |
catch ( const std::length_error & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
107 |
{ detail::report_exception( out, "std::length_error:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
108 |
catch ( const std::out_of_range & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
109 |
{ detail::report_exception( out, "std::out_of_range:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
110 |
catch ( const std::range_error & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
111 |
{ detail::report_exception( out, "std::range_error:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
112 |
catch ( const std::overflow_error & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
113 |
{ detail::report_exception( out, "std::overflow_error:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
114 |
catch ( const std::underflow_error & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
115 |
{ detail::report_exception( out, "std::underflow_error:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
116 |
catch ( const std::logic_error & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
117 |
{ detail::report_exception( out, "std::logic_error:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
118 |
catch ( const std::runtime_error & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
119 |
{ detail::report_exception( out, "std::runtime_error:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
120 |
catch ( const std::exception & ex ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
121 |
{ detail::report_exception( out, "std::exception:", ex.what() ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
122 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
123 |
catch ( ... ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
124 |
{ detail::report_exception( out, "unknown exception", "" ); } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
125 |
#endif // BOOST_NO_EXCEPTIONS |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
126 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
127 |
if ( exception_thrown ) result = boost::exit_exception_failure; |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
128 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
129 |
if ( result != 0 && result != exit_success ) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
130 |
{ |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
131 |
out << std::endl << "**** returning with error code " |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
132 |
<< result << std::endl; |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
133 |
err |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
134 |
<< "********** errors detected; see stdout for details ***********" |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
135 |
<< std::endl; |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
136 |
} |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
137 |
#if !defined(BOOST_NO_CPP_MAIN_SUCCESS_MESSAGE) |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
138 |
else { out << std::flush << "no errors detected" << std::endl; } |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
139 |
#endif |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
140 |
return result; |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
141 |
} // catch_exceptions |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
142 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
143 |
} // boost |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
144 |
|
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
145 |
#endif // BOOST_CATCH_EXCEPTIONS_HPP |
044383f39525
Convert Build package from SFL to EPL
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
146 |