]>
Commit | Line | Data |
---|---|---|
1 | // boost/detail/lightweight_main.hpp -------------------------------------------------// | |
2 | ||
3 | // Copyright Beman Dawes 2010 | |
4 | ||
5 | // Distributed under the Boost Software License, Version 1.0. | |
6 | // See http://www.boost.org/LICENSE_1_0.txt | |
7 | ||
8 | #include <iostream> | |
9 | #include <exception> | |
10 | ||
11 | //--------------------------------------------------------------------------------------// | |
12 | // // | |
13 | // exception reporting main() that calls cpp_main() // | |
14 | // // | |
15 | //--------------------------------------------------------------------------------------// | |
16 | ||
17 | int cpp_main(int argc, char* argv[]); | |
18 | ||
19 | int main(int argc, char* argv[]) | |
20 | { | |
21 | try | |
22 | { | |
23 | return cpp_main(argc, argv); | |
24 | } | |
25 | ||
26 | catch (const std::exception& ex) | |
27 | { | |
28 | std::cout | |
29 | << "\nERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR\n" | |
30 | << "\n****************************** std::exception *****************************\n" | |
31 | << ex.what() | |
32 | << "\n***************************************************************************\n" | |
33 | << std::endl; | |
34 | } | |
35 | return 1; | |
36 | } |