1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/tools/stlport/stl/_exception.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,185 @@
1.4 +/*
1.5 + * Copyright (c) 1996,1997
1.6 + * Silicon Graphics Computer Systems, Inc.
1.7 + *
1.8 + * Copyright (c) 1999
1.9 + * Boris Fomitchev
1.10 + *
1.11 + * This material is provided "as is", with absolutely no warranty expressed
1.12 + * or implied. Any use is at your own risk.
1.13 + *
1.14 + * Permission to use or copy this software for any purpose is hereby granted
1.15 + * without fee, provided the above notices are retained on all copies.
1.16 + * Permission to modify the code and to distribute modified code is granted,
1.17 + * provided the above notices are retained, and a notice that the code was
1.18 + * modified is included with the above copyright notice.
1.19 + */
1.20 +
1.21 +// The header <exception> contains low-level functions that interact
1.22 +// with a compiler's exception-handling mechanism. It is assumed to
1.23 +// be supplied with the compiler, rather than with the library, because
1.24 +// it is inherently tied very closely to the compiler itself.
1.25 +
1.26 +// On platforms where <exception> does not exist, this header defines
1.27 +// an exception base class. This is *not* a substitute for everything
1.28 +// in <exception>, but it suffices to support a bare minimum of STL
1.29 +// functionality.
1.30 +
1.31 +#ifndef _STLP_INTERNAL_EXCEPTION
1.32 +#define _STLP_INTERNAL_EXCEPTION
1.33 +
1.34 +#if !defined (_STLP_NO_EXCEPTION_HEADER)
1.35 +
1.36 +# if defined ( _UNCAUGHT_EXCEPTION )
1.37 +# undef _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT
1.38 +# endif
1.39 +
1.40 +# if defined (_STLP_BROKEN_EXCEPTION_CLASS)
1.41 +# define exception _STLP_NULLIFIED_BROKEN_EXCEPTION_CLASS
1.42 +# define bad_exception _STLP_NULLIFIED_BROKEN_BAD_EXCEPTION_CLASS
1.43 +# if defined (_STLP_NO_NEW_NEW_HEADER)
1.44 +# include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception.h)
1.45 +# else
1.46 +# include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception)
1.47 +# endif
1.48 +# undef exception
1.49 +# undef bad_exception
1.50 +# else
1.51 +# if defined (_STLP_NO_NEW_NEW_HEADER)
1.52 +# include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception.h)
1.53 +# else
1.54 +# include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception)
1.55 +# endif
1.56 +# endif
1.57 +
1.58 +# if defined (_STLP_HAS_SPECIFIC_PROLOG_EPILOG) && (defined (_STLP_MSVC) || defined (__ICL))
1.59 +// dwa 02/04/00 - here I'm assuming that __ICL uses the same library headers as vc6.
1.60 +// the header <yvals.h> which ships with vc6 and is included by its native <exception>
1.61 +// actually turns on warnings, so we have to turn them back off.
1.62 +# include <stl/config/_warnings_off.h>
1.63 +# endif
1.64 +
1.65 +# if defined (_STLP_USE_OWN_NAMESPACE)
1.66 +
1.67 +_STLP_BEGIN_NAMESPACE
1.68 +# if !defined (_STLP_BROKEN_EXCEPTION_CLASS)
1.69 +# if !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_WIN64)
1.70 +using _STLP_VENDOR_EXCEPT_STD::exception;
1.71 +# else
1.72 +using ::exception;
1.73 +# endif
1.74 +using _STLP_VENDOR_EXCEPT_STD::bad_exception;
1.75 +# endif
1.76 +
1.77 +# if !defined (_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS)
1.78 +// fbp : many platforms present strange mix of
1.79 +// those in various namespaces
1.80 +# if !defined (_STLP_VENDOR_UNEXPECTED_STD)
1.81 +# define _STLP_VENDOR_UNEXPECTED_STD _STLP_VENDOR_EXCEPT_STD
1.82 +# else
1.83 +/* The following definitions are for backward compatibility as _STLP_VENDOR_TERMINATE_STD
1.84 + * and _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD has been introduce after _STLP_VENDOR_UNEXPECTED_STD
1.85 + * and _STLP_VENDOR_UNEXPECTED_STD was the macro used in their place before that introduction.
1.86 + */
1.87 +# if !defined (_STLP_VENDOR_TERMINATE_STD)
1.88 +# define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_UNEXPECTED_STD
1.89 +# endif
1.90 +# if !defined (_STLP_VENDOR_UNCAUGHT_EXCEPTION_STD)
1.91 +# define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_UNEXPECTED_STD
1.92 +# endif
1.93 +# endif
1.94 +# if !defined (_STLP_VENDOR_TERMINATE_STD)
1.95 +# define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_EXCEPT_STD
1.96 +# endif
1.97 +# if !defined (_STLP_VENDOR_UNCAUGHT_EXCEPTION_STD)
1.98 +# define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_EXCEPT_STD
1.99 +# endif
1.100 +# if !defined (_STLP_VENDOR_TERMINATE_STD)
1.101 +# define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_EXCEPT_STD
1.102 +# endif
1.103 +# if !defined (_STLP_VENDOR_UNCAUGHT_EXCEPTION_STD)
1.104 +# define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_EXCEPT_STD
1.105 +# endif
1.106 +// weird errors
1.107 +# if !defined (_STLP_NO_UNEXPECTED_EXCEPT_SUPPORT)
1.108 +# if defined (__ICL) && (__ICL >= 900) && (_STLP_MSVC_LIB < 1300)
1.109 +//See config/_intel.h for reason about this workaround
1.110 +using std::unexpected;
1.111 +# else
1.112 +using _STLP_VENDOR_UNEXPECTED_STD::unexpected;
1.113 +# endif
1.114 +using _STLP_VENDOR_UNEXPECTED_STD::unexpected_handler;
1.115 +using _STLP_VENDOR_UNEXPECTED_STD::set_unexpected;
1.116 +# endif
1.117 +using _STLP_VENDOR_TERMINATE_STD::terminate;
1.118 +using _STLP_VENDOR_TERMINATE_STD::terminate_handler;
1.119 +using _STLP_VENDOR_TERMINATE_STD::set_terminate;
1.120 +
1.121 +# if !defined (_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT)
1.122 +using _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD::uncaught_exception;
1.123 +# endif
1.124 +# endif /* !_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS */
1.125 +_STLP_END_NAMESPACE
1.126 +# endif /* _STLP_OWN_NAMESPACE */
1.127 +#else /* _STLP_NO_EXCEPTION_HEADER */
1.128 +
1.129 +/* fbp : absence of <exception> usually means that those
1.130 + * functions are not going to be called by compiler.
1.131 + * Still, define them for the user.
1.132 + * dums: Policy modification, if the function do not behave like the Standard
1.133 + * defined it we do not grant it in the STLport namespace. We will have
1.134 + * compile time error rather than runtime error.
1.135 + */
1.136 +#if 0
1.137 +/*
1.138 +typedef void (*unexpected_handler)();
1.139 +unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY;
1.140 +void unexpected();
1.141 +
1.142 +typedef void (*terminate_handler)();
1.143 +terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY;
1.144 +void terminate();
1.145 +
1.146 +bool uncaught_exception(); // not implemented under mpw as of Jan/1999
1.147 +*/
1.148 +#endif
1.149 +
1.150 +#endif /* _STLP_NO_EXCEPTION_HEADER */
1.151 +
1.152 +#if defined (_STLP_NO_EXCEPTION_HEADER) || defined (_STLP_BROKEN_EXCEPTION_CLASS)
1.153 +_STLP_BEGIN_NAMESPACE
1.154 +
1.155 +// section 18.6.1
1.156 +class _STLP_CLASS_DECLSPEC exception {
1.157 +public:
1.158 +# ifndef _STLP_USE_NO_IOSTREAMS
1.159 + exception() _STLP_NOTHROW;
1.160 + virtual ~exception() _STLP_NOTHROW;
1.161 + virtual const char* what() const _STLP_NOTHROW;
1.162 +# else
1.163 + exception() _STLP_NOTHROW {}
1.164 + virtual ~exception() _STLP_NOTHROW {}
1.165 + virtual const char* what() const _STLP_NOTHROW {return "class exception";}
1.166 +# endif
1.167 +};
1.168 +
1.169 +// section 18.6.2.1
1.170 +class _STLP_CLASS_DECLSPEC bad_exception : public exception {
1.171 +public:
1.172 +# ifndef _STLP_USE_NO_IOSTREAMS
1.173 + bad_exception() _STLP_NOTHROW;
1.174 + ~bad_exception() _STLP_NOTHROW;
1.175 + const char* what() const _STLP_NOTHROW;
1.176 +# else
1.177 + bad_exception() _STLP_NOTHROW {}
1.178 + ~bad_exception() _STLP_NOTHROW {}
1.179 + const char* what() const _STLP_NOTHROW {return "class bad_exception";}
1.180 +# endif
1.181 +};
1.182 +
1.183 +// forward declaration
1.184 +class __Named_exception;
1.185 +_STLP_END_NAMESPACE
1.186 +#endif
1.187 +
1.188 +#endif /* _STLP_INTERNAL_EXCEPTION */