1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/stlportv5/exception Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,229 @@
1.4 +/*
1.5 + * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.6 + *
1.7 + * Copyright (c) 1996,1997
1.8 + * Silicon Graphics Computer Systems, Inc.
1.9 + *
1.10 + * Copyright (c) 1999
1.11 + * Boris Fomitchev
1.12 + *
1.13 + * This material is provided "as is", with absolutely no warranty expressed
1.14 + * or implied. Any use is at your own risk.
1.15 + *
1.16 + * Permission to use or copy this software for any purpose is hereby granted
1.17 + * without fee, provided the above notices are retained on all copies.
1.18 + * Permission to modify the code and to distribute modified code is granted,
1.19 + * provided the above notices are retained, and a notice that the code was
1.20 + * modified is included with the above copyright notice.
1.21 + *
1.22 + */
1.23 +
1.24 +// This header exists solely for portability. Normally it just includes
1.25 +// the native header <exception>.
1.26 +
1.27 +// The header <exception> contains low-level functions that interact
1.28 +// with a compiler's exception-handling mechanism. It is assumed to
1.29 +// be supplied with the compiler, rather than with the library, because
1.30 +// it is inherently tied very closely to the compiler itself.
1.31 +
1.32 +// On platforms where <exception> does not exist, this header defines
1.33 +// an exception base class. This is *not* a substitute for everything
1.34 +// in <exception>, but it suffices to support a bare minimum of STL
1.35 +// functionality.
1.36 +
1.37 +
1.38 +# if !defined (_STLP_OUTERMOST_HEADER_ID)
1.39 +# define _STLP_OUTERMOST_HEADER_ID 0x423
1.40 +# include <stl/_prolog.h>
1.41 +# elif (_STLP_OUTERMOST_HEADER_ID == 0x423) && ! defined (_STLP_DONT_POP_0x423)
1.42 +# define _STLP_DONT_POP_0x423
1.43 +# endif
1.44 +
1.45 +#ifndef _STLP_EXCEPTION
1.46 +#define _STLP_EXCEPTION
1.47 +
1.48 +# if ! defined (_STLP_NO_EXCEPTION_HEADER)
1.49 +
1.50 +# if defined ( _UNCAUGHT_EXCEPTION )
1.51 +# undef _STLP_INCOMPLETE_EXCEPTION_HEADER
1.52 +# endif
1.53 +
1.54 +# if defined(_STLP_BROKEN_EXCEPTION_CLASS)
1.55 +# define exception _STLP_NULLIFIED_BROKEN_EXCEPTION_CLASS
1.56 +# define bad_exception _STLP_NULLIFIED_BROKEN_BAD_EXCEPTION_CLASS
1.57 +# if defined (_STLP_NO_NEW_NEW_HEADER)
1.58 +# include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception.h)
1.59 +# else
1.60 +# include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception)
1.61 +# endif
1.62 +# undef exception
1.63 +# undef bad_exception
1.64 +# else
1.65 +
1.66 +#ifndef _STLP_NO_NEW_NEW_HEADER
1.67 +#define _STLP_NO_NEW_NEW_HEADER
1.68 +#endif
1.69 +
1.70 +# if defined (_STLP_NO_NEW_NEW_HEADER)
1.71 +# include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception.h)
1.72 +# else
1.73 +# include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception)
1.74 +# endif
1.75 +
1.76 +# endif
1.77 +
1.78 +# if defined (_STLP_MSVC) || defined (__ICL)
1.79 +// dwa 02/04/00 - here I'm assuming that __ICL uses the same library headers as vc6.
1.80 +// the header <yvals.h> which ships with vc6 and is included by its native <exception>
1.81 +// actually turns on warnings, so we have to turn them back off.
1.82 +# include <config/_msvc_warnings_off.h>
1.83 +# endif
1.84 +
1.85 +
1.86 +# ifdef _STLP_USE_OWN_NAMESPACE
1.87 +
1.88 +_STLP_BEGIN_NAMESPACE
1.89 +
1.90 +#if !defined(_STLP_BROKEN_EXCEPTION_CLASS)
1.91 +using _STLP_VENDOR_EXCEPT_STD::exception;
1.92 +using _STLP_VENDOR_EXCEPT_STD::bad_exception;
1.93 +#endif
1.94 +
1.95 +# if ! defined (_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS)
1.96 +
1.97 +// fbp : many platforms present strange mix of
1.98 +// those in various namespaces
1.99 +# if !defined(_STLP_VENDOR_UNEXPECTED_STD)
1.100 +# define _STLP_VENDOR_UNEXPECTED_STD _STLP_VENDOR_EXCEPT_STD
1.101 +# endif
1.102 +
1.103 +// weird errors
1.104 +# if (! defined (__BORLANDC__)) || (defined (__STD_EXCEPTION) && defined (__RWSTD_EXCEPTION_SEEN) && defined ( _STLP_DONT_POP_0x423))
1.105 +using _STLP_VENDOR_UNEXPECTED_STD::unexpected;
1.106 +using _STLP_VENDOR_UNEXPECTED_STD::unexpected_handler;
1.107 +using _STLP_VENDOR_UNEXPECTED_STD::set_unexpected;
1.108 +using _STLP_VENDOR_UNEXPECTED_STD::terminate;
1.109 +using _STLP_VENDOR_UNEXPECTED_STD::terminate_handler;
1.110 +using _STLP_VENDOR_UNEXPECTED_STD::set_terminate;
1.111 +# endif
1.112 +
1.113 +# if !defined (_STLP_INCOMPLETE_EXCEPTION_HEADER)
1.114 +using _STLP_VENDOR_UNEXPECTED_STD::uncaught_exception;
1.115 +# endif
1.116 +
1.117 +# endif
1.118 +
1.119 +_STLP_END_NAMESPACE
1.120 +
1.121 +# endif /* _STLP_OWN_NAMESPACE */
1.122 +
1.123 +#else /* _STLP_NO_EXCEPTION_HEADER */
1.124 +
1.125 +// fbp : absence of <exception> usually means that those
1.126 +// functions are not going to be called by compiler.
1.127 +// Still, define them for the user.
1.128 +#ifdef __SYMBIAN32__
1.129 +_STLP_BEGIN_NAMESPACE
1.130 +#endif //__SYMBIAN32__
1.131 +typedef void (*unexpected_handler)();
1.132 +unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY;
1.133 +void unexpected();
1.134 +
1.135 +typedef void (*terminate_handler)();
1.136 +terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY;
1.137 +void terminate();
1.138 +
1.139 +bool uncaught_exception(); // not implemented under mpw as of Jan/1999
1.140 +
1.141 +#ifdef __SYMBIAN32__
1.142 +_STLP_END_NAMESPACE
1.143 +#endif //__SYMBIAN32__
1.144 +
1.145 +#endif /* _STLP_NO_EXCEPTION_HEADER */
1.146 +
1.147 +# if defined (_STLP_NO_EXCEPTION_HEADER) || defined(_STLP_BROKEN_EXCEPTION_CLASS)
1.148 +# ifndef _STLP_EXCEPTION_H
1.149 +# define _STLP_EXCEPTION_H
1.150 +
1.151 +_STLP_BEGIN_NAMESPACE
1.152 +
1.153 +// section 18.6.1
1.154 +#ifdef __SYMBIAN32__
1.155 +class exception
1.156 +#else
1.157 +class _STLP_CLASS_DECLSPEC exception
1.158 +#endif
1.159 + {
1.160 + public:
1.161 +# ifdef _STLP_OWN_IOSTREAMS
1.162 + _STLP_DECLSPEC exception() _STLP_NOTHROW;
1.163 + _STLP_DECLSPEC virtual ~exception() _STLP_NOTHROW;
1.164 + _STLP_DECLSPEC virtual const char* what() const _STLP_NOTHROW;
1.165 +# else
1.166 + exception() _STLP_NOTHROW {}
1.167 + virtual ~exception() _STLP_NOTHROW {}
1.168 + virtual const char* what() const _STLP_NOTHROW {return "class exception";}
1.169 +# endif
1.170 + };
1.171 +
1.172 +
1.173 +
1.174 +// section 18.6.2.1
1.175 +#ifdef __SYMBIAN32__
1.176 +class bad_exception : public exception
1.177 +#else
1.178 +class _STLP_CLASS_DECLSPEC bad_exception : public exception
1.179 +#endif
1.180 + {
1.181 + public:
1.182 +# ifdef _STLP_OWN_IOSTREAMS
1.183 + _STLP_DECLSPEC bad_exception() _STLP_NOTHROW;
1.184 + _STLP_DECLSPEC ~bad_exception() _STLP_NOTHROW;
1.185 + _STLP_DECLSPEC const char* what() const _STLP_NOTHROW;
1.186 +# else
1.187 + bad_exception() _STLP_NOTHROW {}
1.188 + ~bad_exception() _STLP_NOTHROW {}
1.189 + const char* what() const _STLP_NOTHROW {return "class bad_exception";}
1.190 +# endif
1.191 + };
1.192 +
1.193 +#ifdef __SYMBIAN32__
1.194 +// Give forward declaration, this should be supported by the stdard libraries from platform vendor.
1.195 +typedef void (*unexpected_handler)();
1.196 +_STLP_DECLSPEC unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY;
1.197 +_STLP_DECLSPEC void unexpected();
1.198 +
1.199 +typedef void (*terminate_handler)();
1.200 +_STLP_DECLSPEC terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY;
1.201 +_STLP_DECLSPEC void terminate();
1.202 +
1.203 +_STLP_DECLSPEC bool uncaught_exception(); // not implemented under mpw as of Jan/1999
1.204 +
1.205 +#endif
1.206 +_STLP_END_NAMESPACE
1.207 +
1.208 +#endif /* _STLP_NO_EXCEPTION_HEADER */
1.209 +
1.210 +_STLP_BEGIN_NAMESPACE
1.211 +// forward declaration
1.212 +class __Named_exception;
1.213 +_STLP_END_NAMESPACE
1.214 +#endif /* _STLP_EXCEPTION_H */
1.215 +
1.216 +#endif //_STLP_EXCEPTION
1.217 +
1.218 +# if (_STLP_OUTERMOST_HEADER_ID == 0x423)
1.219 +# if ! defined (_STLP_DONT_POP_0x423)
1.220 +# include <stl/_epilog.h>
1.221 +# undef _STLP_OUTERMOST_HEADER_ID
1.222 +# endif
1.223 +# undef _STLP_DONT_POP_0x423
1.224 +# endif
1.225 +
1.226 +
1.227 +// Local Variables:
1.228 +// mode:C++
1.229 +// End:
1.230 +
1.231 +
1.232 +