1.1 --- a/epoc32/include/stdapis/stlportv5/exception Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/stdapis/stlportv5/exception Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,229 +1,116 @@
1.4 /*
1.5 - * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.6 + * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(- * * ies).
1.7 + * All rights reserved.
1.8 + * This component and the accompanying materials are made available
1.9 + * under the terms of the License "Eclipse Public License v1.0"
1.10 + * which accompanies this distribution, and is available
1.11 + * at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.12 *
1.13 - * Copyright (c) 1996,1997
1.14 - * Silicon Graphics Computer Systems, Inc.
1.15 + * Initial Contributors:
1.16 + * Nokia Corporation - initial contribution.
1.17 *
1.18 - * Copyright (c) 1999
1.19 - * Boris Fomitchev
1.20 + * Contributors:
1.21 *
1.22 - * This material is provided "as is", with absolutely no warranty expressed
1.23 - * or implied. Any use is at your own risk.
1.24 - *
1.25 - * Permission to use or copy this software for any purpose is hereby granted
1.26 - * without fee, provided the above notices are retained on all copies.
1.27 - * Permission to modify the code and to distribute modified code is granted,
1.28 - * provided the above notices are retained, and a notice that the code was
1.29 - * modified is included with the above copyright notice.
1.30 + * Description:
1.31 + * Name : exception
1.32 + * Part of : standard c++ library.
1.33 *
1.34 */
1.35
1.36 -// This header exists solely for portability. Normally it just includes
1.37 -// the native header <exception>.
1.38
1.39 -// The header <exception> contains low-level functions that interact
1.40 -// with a compiler's exception-handling mechanism. It is assumed to
1.41 -// be supplied with the compiler, rather than with the library, because
1.42 -// it is inherently tied very closely to the compiler itself.
1.43
1.44 -// On platforms where <exception> does not exist, this header defines
1.45 -// an exception base class. This is *not* a substitute for everything
1.46 -// in <exception>, but it suffices to support a bare minimum of STL
1.47 -// functionality.
1.48
1.49 +#ifndef _SYMCPP_EXCEPTION_H_
1.50 +#define _SYMCPP_EXCEPTION_H_
1.51
1.52 -# if !defined (_STLP_OUTERMOST_HEADER_ID)
1.53 -# define _STLP_OUTERMOST_HEADER_ID 0x423
1.54 -# include <stl/_prolog.h>
1.55 -# elif (_STLP_OUTERMOST_HEADER_ID == 0x423) && ! defined (_STLP_DONT_POP_0x423)
1.56 -# define _STLP_DONT_POP_0x423
1.57 -# endif
1.58 +#ifdef __EABI__
1.59 +/* EABI specific definitions */
1.60 +#include <e32def.h>
1.61 +namespace std
1.62 +{
1.63 + class exception
1.64 + {
1.65 + public:
1.66 + IMPORT_C exception() __NO_THROW;
1.67 + IMPORT_C exception(const exception&) __NO_THROW;
1.68 + IMPORT_C exception& operator=(const exception&) __NO_THROW;
1.69 + IMPORT_C virtual ~exception() __NO_THROW;
1.70 + IMPORT_C virtual const char* what() const __NO_THROW;
1.71 + };
1.72
1.73 -#ifndef _STLP_EXCEPTION
1.74 -#define _STLP_EXCEPTION
1.75 + class bad_exception : public exception
1.76 + {
1.77 + public:
1.78 + IMPORT_C bad_exception() __NO_THROW;
1.79 + IMPORT_C bad_exception(const bad_exception&) __NO_THROW;
1.80 + IMPORT_C bad_exception& operator=(const bad_exception&) __NO_THROW;
1.81 + IMPORT_C virtual ~bad_exception() __NO_THROW;
1.82 + IMPORT_C virtual const char* what() const __NO_THROW;
1.83 + };
1.84
1.85 -# if ! defined (_STLP_NO_EXCEPTION_HEADER)
1.86 + typedef void (*unexpected_handler)();
1.87
1.88 -# if defined ( _UNCAUGHT_EXCEPTION )
1.89 -# undef _STLP_INCOMPLETE_EXCEPTION_HEADER
1.90 -# endif
1.91 + IMPORT_C unexpected_handler set_unexpected(unexpected_handler) __NO_THROW;
1.92 + IMPORT_C void unexpected();
1.93
1.94 -# if defined(_STLP_BROKEN_EXCEPTION_CLASS)
1.95 -# define exception _STLP_NULLIFIED_BROKEN_EXCEPTION_CLASS
1.96 -# define bad_exception _STLP_NULLIFIED_BROKEN_BAD_EXCEPTION_CLASS
1.97 -# if defined (_STLP_NO_NEW_NEW_HEADER)
1.98 -# include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception.h)
1.99 + typedef void (*terminate_handler)();
1.100 +
1.101 + IMPORT_C terminate_handler set_terminate(terminate_handler) __NO_THROW;
1.102 + IMPORT_C void terminate();
1.103 +
1.104 + IMPORT_C extern bool uncaught_exception() __NO_THROW;
1.105 +}
1.106 +
1.107 +
1.108 +
1.109 # else
1.110 -# include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception)
1.111 -# endif
1.112 -# undef exception
1.113 -# undef bad_exception
1.114 -# else
1.115
1.116 -#ifndef _STLP_NO_NEW_NEW_HEADER
1.117 -#define _STLP_NO_NEW_NEW_HEADER
1.118 -#endif
1.119 +/* Declarations common to all other platforms (Non-EABI) here.
1.120 + * WINSCW specific definitions are in exception_winscw.h
1.121 + */
1.122 +# include <e32def.h>
1.123
1.124 -# if defined (_STLP_NO_NEW_NEW_HEADER)
1.125 -# include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception.h)
1.126 -# else
1.127 -# include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception)
1.128 -# endif
1.129 +namespace std {
1.130
1.131 -# endif
1.132 + class exception {
1.133 + public:
1.134 + exception() __NO_THROW;
1.135 + exception(const exception&) __NO_THROW;
1.136 + exception& operator=(const exception&) __NO_THROW;
1.137 + virtual ~exception() __NO_THROW;
1.138 + virtual const char* what() const __NO_THROW;
1.139 + };
1.140
1.141 -# if defined (_STLP_MSVC) || defined (__ICL)
1.142 -// dwa 02/04/00 - here I'm assuming that __ICL uses the same library headers as vc6.
1.143 -// the header <yvals.h> which ships with vc6 and is included by its native <exception>
1.144 -// actually turns on warnings, so we have to turn them back off.
1.145 -# include <config/_msvc_warnings_off.h>
1.146 -# endif
1.147 + class bad_exception : public exception {
1.148 + public:
1.149 + bad_exception() __NO_THROW;
1.150 + bad_exception(const bad_exception&) __NO_THROW;
1.151 + bad_exception& operator=(const bad_exception&) __NO_THROW;
1.152 + virtual ~bad_exception() __NO_THROW;
1.153 + virtual const char* what() const __NO_THROW;
1.154 + };
1.155
1.156 + typedef void (*terminate_handler)();
1.157 + extern terminate_handler set_terminate(terminate_handler) __NO_THROW;
1.158
1.159 -# ifdef _STLP_USE_OWN_NAMESPACE
1.160 + typedef void (*unexpected_handler)();
1.161 + extern unexpected_handler set_unexpected(unexpected_handler) __NO_THROW;
1.162
1.163 -_STLP_BEGIN_NAMESPACE
1.164 + void terminate();
1.165 + void unexpected();
1.166 + bool uncaught_exception() __NO_THROW;
1.167
1.168 -#if !defined(_STLP_BROKEN_EXCEPTION_CLASS)
1.169 -using _STLP_VENDOR_EXCEPT_STD::exception;
1.170 -using _STLP_VENDOR_EXCEPT_STD::bad_exception;
1.171 -#endif
1.172 +}
1.173
1.174 -# if ! defined (_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS)
1.175 +# ifdef __WINSCW__
1.176 +/*
1.177 + * C++ Exception specific stuff required from the CW runtime.
1.178 + * Certain functions are implemented inline in CW headers.
1.179 + * We're providing the same in exception_winscw.h
1.180 + */
1.181 +# include <stdapis/stlportv5/exception_winscw.h>
1.182 +# endif //__WINSCW__
1.183
1.184 -// fbp : many platforms present strange mix of
1.185 -// those in various namespaces
1.186 -# if !defined(_STLP_VENDOR_UNEXPECTED_STD)
1.187 -# define _STLP_VENDOR_UNEXPECTED_STD _STLP_VENDOR_EXCEPT_STD
1.188 -# endif
1.189 +#endif // __EABI__
1.190 +#endif //_SYMCPP_EXCEPTION_
1.191
1.192 -// weird errors
1.193 -# if (! defined (__BORLANDC__)) || (defined (__STD_EXCEPTION) && defined (__RWSTD_EXCEPTION_SEEN) && defined ( _STLP_DONT_POP_0x423))
1.194 -using _STLP_VENDOR_UNEXPECTED_STD::unexpected;
1.195 -using _STLP_VENDOR_UNEXPECTED_STD::unexpected_handler;
1.196 -using _STLP_VENDOR_UNEXPECTED_STD::set_unexpected;
1.197 -using _STLP_VENDOR_UNEXPECTED_STD::terminate;
1.198 -using _STLP_VENDOR_UNEXPECTED_STD::terminate_handler;
1.199 -using _STLP_VENDOR_UNEXPECTED_STD::set_terminate;
1.200 -# endif
1.201 -
1.202 -# if !defined (_STLP_INCOMPLETE_EXCEPTION_HEADER)
1.203 -using _STLP_VENDOR_UNEXPECTED_STD::uncaught_exception;
1.204 -# endif
1.205 -
1.206 -# endif
1.207 -
1.208 -_STLP_END_NAMESPACE
1.209 -
1.210 -# endif /* _STLP_OWN_NAMESPACE */
1.211 -
1.212 -#else /* _STLP_NO_EXCEPTION_HEADER */
1.213 -
1.214 -// fbp : absence of <exception> usually means that those
1.215 -// functions are not going to be called by compiler.
1.216 -// Still, define them for the user.
1.217 -#ifdef __SYMBIAN32__
1.218 -_STLP_BEGIN_NAMESPACE
1.219 -#endif //__SYMBIAN32__
1.220 -typedef void (*unexpected_handler)();
1.221 -unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY;
1.222 -void unexpected();
1.223 -
1.224 -typedef void (*terminate_handler)();
1.225 -terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY;
1.226 -void terminate();
1.227 -
1.228 -bool uncaught_exception(); // not implemented under mpw as of Jan/1999
1.229 -
1.230 -#ifdef __SYMBIAN32__
1.231 -_STLP_END_NAMESPACE
1.232 -#endif //__SYMBIAN32__
1.233 -
1.234 -#endif /* _STLP_NO_EXCEPTION_HEADER */
1.235 -
1.236 -# if defined (_STLP_NO_EXCEPTION_HEADER) || defined(_STLP_BROKEN_EXCEPTION_CLASS)
1.237 -# ifndef _STLP_EXCEPTION_H
1.238 -# define _STLP_EXCEPTION_H
1.239 -
1.240 -_STLP_BEGIN_NAMESPACE
1.241 -
1.242 -// section 18.6.1
1.243 -#ifdef __SYMBIAN32__
1.244 -class exception
1.245 -#else
1.246 -class _STLP_CLASS_DECLSPEC exception
1.247 -#endif
1.248 - {
1.249 - public:
1.250 -# ifdef _STLP_OWN_IOSTREAMS
1.251 - _STLP_DECLSPEC exception() _STLP_NOTHROW;
1.252 - _STLP_DECLSPEC virtual ~exception() _STLP_NOTHROW;
1.253 - _STLP_DECLSPEC virtual const char* what() const _STLP_NOTHROW;
1.254 -# else
1.255 - exception() _STLP_NOTHROW {}
1.256 - virtual ~exception() _STLP_NOTHROW {}
1.257 - virtual const char* what() const _STLP_NOTHROW {return "class exception";}
1.258 -# endif
1.259 - };
1.260 -
1.261 -
1.262 -
1.263 -// section 18.6.2.1
1.264 -#ifdef __SYMBIAN32__
1.265 -class bad_exception : public exception
1.266 -#else
1.267 -class _STLP_CLASS_DECLSPEC bad_exception : public exception
1.268 -#endif
1.269 - {
1.270 - public:
1.271 -# ifdef _STLP_OWN_IOSTREAMS
1.272 - _STLP_DECLSPEC bad_exception() _STLP_NOTHROW;
1.273 - _STLP_DECLSPEC ~bad_exception() _STLP_NOTHROW;
1.274 - _STLP_DECLSPEC const char* what() const _STLP_NOTHROW;
1.275 -# else
1.276 - bad_exception() _STLP_NOTHROW {}
1.277 - ~bad_exception() _STLP_NOTHROW {}
1.278 - const char* what() const _STLP_NOTHROW {return "class bad_exception";}
1.279 -# endif
1.280 - };
1.281 -
1.282 -#ifdef __SYMBIAN32__
1.283 -// Give forward declaration, this should be supported by the stdard libraries from platform vendor.
1.284 -typedef void (*unexpected_handler)();
1.285 -_STLP_DECLSPEC unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY;
1.286 -_STLP_DECLSPEC void unexpected();
1.287 -
1.288 -typedef void (*terminate_handler)();
1.289 -_STLP_DECLSPEC terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY;
1.290 -_STLP_DECLSPEC void terminate();
1.291 -
1.292 -_STLP_DECLSPEC bool uncaught_exception(); // not implemented under mpw as of Jan/1999
1.293 -
1.294 -#endif
1.295 -_STLP_END_NAMESPACE
1.296 -
1.297 -#endif /* _STLP_NO_EXCEPTION_HEADER */
1.298 -
1.299 -_STLP_BEGIN_NAMESPACE
1.300 -// forward declaration
1.301 -class __Named_exception;
1.302 -_STLP_END_NAMESPACE
1.303 -#endif /* _STLP_EXCEPTION_H */
1.304 -
1.305 -#endif //_STLP_EXCEPTION
1.306 -
1.307 -# if (_STLP_OUTERMOST_HEADER_ID == 0x423)
1.308 -# if ! defined (_STLP_DONT_POP_0x423)
1.309 -# include <stl/_epilog.h>
1.310 -# undef _STLP_OUTERMOST_HEADER_ID
1.311 -# endif
1.312 -# undef _STLP_DONT_POP_0x423
1.313 -# endif
1.314 -
1.315 -
1.316 -// Local Variables:
1.317 -// mode:C++
1.318 -// End:
1.319 -
1.320 -
1.321 -