Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
GLOBAL_UNCAUGHT_EXCEPTION.cpp
Go to the documentation of this file.
1// checking for ::uncaught_exception()
2
3
25#include "config.h"
26
27
28#ifndef _RWSTD_NO_HONOR_STD
29# ifdef _RWSTD_NO_STD_TERMINATE
30# include "terminate.h"
31# endif // _RWSTD_NO_STD_TERMINATE
32#endif // _RWSTD_NO_HONOR_STD
33
34
35// looking for a definition in compiler support library
36bool uncaught_exception ();
37
38
40
41struct S {
42 ~S () {
44 }
45};
46
47
48int main (int argc, char *argv[])
49{
50 (void)&argv;
51
52#ifndef _RWSTD_NO_EXCEPTIONS
53
54 try {
55 S s;
56
57 // do not actually invoke uncaught_exception()
58 // unless at least one command-line argument
59 // is specified (done to prevent the compiler
60 // from optimizing the function call away)
61 if (argc > 1)
62 throw 0;
63 }
64 catch (...) {
65 }
66
67#endif // _RWSTD_NO_EXCEPTIONS
68
69 return uncaught;
70}
#define s
#define main
bool uncaught_exception()
bool(* uncaught_exception)()