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