Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
LIB_EXCEPTIONS.cpp
Go to the documentation of this file.
1// checking library exceptions
2
3
25#include "config.h"
26
27#if 0 // guard invalid preprocessor symbol below
28
29 // establish a dependency on lib_exceptions.lib.*
30# ifndef _RWSTD_NO_lib_exceptions.lib
31
32 // link this compiled translation unit with the lib below
33 // LDOPTS = lib_exceptions.lib$(LIBSUFFIX)
34
35# endif // _RWSTD_NO_lib_exceptions.lib
36#endif // 0
37
38
39#ifndef _RWSTD_NO_HONOR_STD
40# ifdef _RWSTD_NO_STD_TERMINATE
41# include "terminate.h"
42# endif // _RWSTD_NO_STD_TERMINATE
43#endif // _RWSTD_NO_HONOR_STD
44
45
46// defined in a library, throws an exception
47int foo (int);
48
49
50int main ()
51{
52 try {
53 // expected to throw an exception
54 return foo (1);
55 }
56 catch (...) {
57 // success: exception caught
58 return 0;
59 }
60
61 // failure: no exception thrown
62 return 1;
63}
int main()
#define foo(buf, s,...)