Sync with trunk.
[reactos.git] / include / c++ / exception
1 // Exception Handling support header for -*- C++ -*-
2
3 #ifndef __EXCEPTION__
4 #define __EXCEPTION__
5
6 extern "C++" {
7
8 class exception
9 {
10 public:
11 exception() throw();
12 exception(const char * const &) throw();
13 exception(const char * const &, int) throw();
14
15 virtual ~exception() throw();
16
17 virtual const char *what() const throw();
18 private:
19 const char *_name;
20 int _do_free;
21 };
22
23 class bad_exception : public exception
24 {
25 public:
26 bad_exception(const char *name = "bad exception") throw()
27 : exception(name) { }
28
29 virtual ~bad_exception() throw() { }
30 };
31
32 namespace std
33 {
34 using ::exception;
35 using ::bad_exception;
36
37 typedef void (*unexpected_handler) ();
38
39 unexpected_handler set_unexpected(unexpected_handler) throw();
40
41 __MINGW_ATTRIB_NORETURN void unexpected();
42
43 bool uncaught_exception() throw();
44 } // namespace std
45
46 typedef void (*terminate_handler) ();
47 terminate_handler set_terminate(terminate_handler) throw();
48 __MINGW_ATTRIB_NORETURN void terminate() throw();
49
50 } // extern "C++"
51
52 #endif