williamr@4: /* williamr@4: * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved. williamr@4: * williamr@4: * Copyright (c) 1996,1997 williamr@4: * Silicon Graphics Computer Systems, Inc. williamr@4: * williamr@4: * Copyright (c) 1999 williamr@4: * Boris Fomitchev williamr@4: * williamr@4: * This material is provided "as is", with absolutely no warranty expressed williamr@4: * or implied. Any use is at your own risk. williamr@4: * williamr@4: * Permission to use or copy this software for any purpose is hereby granted williamr@4: * without fee, provided the above notices are retained on all copies. williamr@4: * Permission to modify the code and to distribute modified code is granted, williamr@4: * provided the above notices are retained, and a notice that the code was williamr@4: * modified is included with the above copyright notice. williamr@4: * williamr@4: */ williamr@4: williamr@4: // This header exists solely for portability. Normally it just includes williamr@4: // the native header . williamr@4: williamr@4: // The header contains low-level functions that interact williamr@4: // with a compiler's exception-handling mechanism. It is assumed to williamr@4: // be supplied with the compiler, rather than with the library, because williamr@4: // it is inherently tied very closely to the compiler itself. williamr@4: williamr@4: // On platforms where does not exist, this header defines williamr@4: // an exception base class. This is *not* a substitute for everything williamr@4: // in , but it suffices to support a bare minimum of STL williamr@4: // functionality. williamr@4: williamr@4: williamr@4: # if !defined (_STLP_OUTERMOST_HEADER_ID) williamr@4: # define _STLP_OUTERMOST_HEADER_ID 0x423 williamr@4: # include williamr@4: # elif (_STLP_OUTERMOST_HEADER_ID == 0x423) && ! defined (_STLP_DONT_POP_0x423) williamr@4: # define _STLP_DONT_POP_0x423 williamr@4: # endif williamr@4: williamr@4: #ifndef _STLP_EXCEPTION williamr@4: #define _STLP_EXCEPTION williamr@4: williamr@4: # if ! defined (_STLP_NO_EXCEPTION_HEADER) williamr@4: williamr@4: # if defined ( _UNCAUGHT_EXCEPTION ) williamr@4: # undef _STLP_INCOMPLETE_EXCEPTION_HEADER williamr@4: # endif williamr@4: williamr@4: # if defined(_STLP_BROKEN_EXCEPTION_CLASS) williamr@4: # define exception _STLP_NULLIFIED_BROKEN_EXCEPTION_CLASS williamr@4: # define bad_exception _STLP_NULLIFIED_BROKEN_BAD_EXCEPTION_CLASS williamr@4: # if defined (_STLP_NO_NEW_NEW_HEADER) williamr@4: # include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception.h) williamr@4: # else williamr@4: # include _STLP_NATIVE_CPP_RUNTIME_HEADER(Exception) williamr@4: # endif williamr@4: # undef exception williamr@4: # undef bad_exception williamr@4: # else williamr@4: williamr@4: #ifndef _STLP_NO_NEW_NEW_HEADER williamr@4: #define _STLP_NO_NEW_NEW_HEADER williamr@4: #endif williamr@4: williamr@4: # if defined (_STLP_NO_NEW_NEW_HEADER) williamr@4: # include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception.h) williamr@4: # else williamr@4: # include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception) williamr@4: # endif williamr@4: williamr@4: # endif williamr@4: williamr@4: # if defined (_STLP_MSVC) || defined (__ICL) williamr@4: // dwa 02/04/00 - here I'm assuming that __ICL uses the same library headers as vc6. williamr@4: // the header which ships with vc6 and is included by its native williamr@4: // actually turns on warnings, so we have to turn them back off. williamr@4: # include williamr@4: # endif williamr@4: williamr@4: williamr@4: # ifdef _STLP_USE_OWN_NAMESPACE williamr@4: williamr@4: _STLP_BEGIN_NAMESPACE williamr@4: williamr@4: #if !defined(_STLP_BROKEN_EXCEPTION_CLASS) williamr@4: using _STLP_VENDOR_EXCEPT_STD::exception; williamr@4: using _STLP_VENDOR_EXCEPT_STD::bad_exception; williamr@4: #endif williamr@4: williamr@4: # if ! defined (_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS) williamr@4: williamr@4: // fbp : many platforms present strange mix of williamr@4: // those in various namespaces williamr@4: # if !defined(_STLP_VENDOR_UNEXPECTED_STD) williamr@4: # define _STLP_VENDOR_UNEXPECTED_STD _STLP_VENDOR_EXCEPT_STD williamr@4: # endif williamr@4: williamr@4: // weird errors williamr@4: # if (! defined (__BORLANDC__)) || (defined (__STD_EXCEPTION) && defined (__RWSTD_EXCEPTION_SEEN) && defined ( _STLP_DONT_POP_0x423)) williamr@4: using _STLP_VENDOR_UNEXPECTED_STD::unexpected; williamr@4: using _STLP_VENDOR_UNEXPECTED_STD::unexpected_handler; williamr@4: using _STLP_VENDOR_UNEXPECTED_STD::set_unexpected; williamr@4: using _STLP_VENDOR_UNEXPECTED_STD::terminate; williamr@4: using _STLP_VENDOR_UNEXPECTED_STD::terminate_handler; williamr@4: using _STLP_VENDOR_UNEXPECTED_STD::set_terminate; williamr@4: # endif williamr@4: williamr@4: # if !defined (_STLP_INCOMPLETE_EXCEPTION_HEADER) williamr@4: using _STLP_VENDOR_UNEXPECTED_STD::uncaught_exception; williamr@4: # endif williamr@4: williamr@4: # endif williamr@4: williamr@4: _STLP_END_NAMESPACE williamr@4: williamr@4: # endif /* _STLP_OWN_NAMESPACE */ williamr@4: williamr@4: #else /* _STLP_NO_EXCEPTION_HEADER */ williamr@4: williamr@4: // fbp : absence of usually means that those williamr@4: // functions are not going to be called by compiler. williamr@4: // Still, define them for the user. williamr@4: #ifdef __SYMBIAN32__ williamr@4: _STLP_BEGIN_NAMESPACE williamr@4: #endif //__SYMBIAN32__ williamr@4: typedef void (*unexpected_handler)(); williamr@4: unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY; williamr@4: void unexpected(); williamr@4: williamr@4: typedef void (*terminate_handler)(); williamr@4: terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY; williamr@4: void terminate(); williamr@4: williamr@4: bool uncaught_exception(); // not implemented under mpw as of Jan/1999 williamr@4: williamr@4: #ifdef __SYMBIAN32__ williamr@4: _STLP_END_NAMESPACE williamr@4: #endif //__SYMBIAN32__ williamr@4: williamr@4: #endif /* _STLP_NO_EXCEPTION_HEADER */ williamr@4: williamr@4: # if defined (_STLP_NO_EXCEPTION_HEADER) || defined(_STLP_BROKEN_EXCEPTION_CLASS) williamr@4: # ifndef _STLP_EXCEPTION_H williamr@4: # define _STLP_EXCEPTION_H williamr@4: williamr@4: _STLP_BEGIN_NAMESPACE williamr@4: williamr@4: // section 18.6.1 williamr@4: #ifdef __SYMBIAN32__ williamr@4: class exception williamr@4: #else williamr@4: class _STLP_CLASS_DECLSPEC exception williamr@4: #endif williamr@4: { williamr@4: public: williamr@4: # ifdef _STLP_OWN_IOSTREAMS williamr@4: IMPORT_C exception() _STLP_NOTHROW; williamr@4: IMPORT_C virtual ~exception() _STLP_NOTHROW; williamr@4: IMPORT_C virtual const char* what() const _STLP_NOTHROW; williamr@4: # else williamr@4: exception() _STLP_NOTHROW {} williamr@4: virtual ~exception() _STLP_NOTHROW {} williamr@4: virtual const char* what() const _STLP_NOTHROW {return "class exception";} williamr@4: # endif williamr@4: }; williamr@4: williamr@4: williamr@4: williamr@4: // section 18.6.2.1 williamr@4: #ifdef __SYMBIAN32__ williamr@4: class bad_exception : public exception williamr@4: #else williamr@4: class _STLP_CLASS_DECLSPEC bad_exception : public exception williamr@4: #endif williamr@4: { williamr@4: public: williamr@4: # ifdef _STLP_OWN_IOSTREAMS williamr@4: _STLP_DECLSPEC bad_exception() _STLP_NOTHROW; williamr@4: _STLP_DECLSPEC ~bad_exception() _STLP_NOTHROW; williamr@4: _STLP_DECLSPEC const char* what() const _STLP_NOTHROW; williamr@4: # else williamr@4: bad_exception() _STLP_NOTHROW {} williamr@4: ~bad_exception() _STLP_NOTHROW {} williamr@4: const char* what() const _STLP_NOTHROW {return "class bad_exception";} williamr@4: # endif williamr@4: }; williamr@4: williamr@4: #ifdef __SYMBIAN32__ williamr@4: // Give forward declaration, this should be supported by the stdard libraries from platform vendor. williamr@4: typedef void (*unexpected_handler)(); williamr@4: _STLP_DECLSPEC unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY; williamr@4: _STLP_DECLSPEC void unexpected(); williamr@4: williamr@4: typedef void (*terminate_handler)(); williamr@4: _STLP_DECLSPEC terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY; williamr@4: _STLP_DECLSPEC void terminate(); williamr@4: williamr@4: _STLP_DECLSPEC bool uncaught_exception(); // not implemented under mpw as of Jan/1999 williamr@4: williamr@4: #endif williamr@4: _STLP_END_NAMESPACE williamr@4: williamr@4: #endif /* _STLP_NO_EXCEPTION_HEADER */ williamr@4: williamr@4: _STLP_BEGIN_NAMESPACE williamr@4: // forward declaration williamr@4: class __Named_exception; williamr@4: _STLP_END_NAMESPACE williamr@4: #endif /* _STLP_EXCEPTION_H */ williamr@4: williamr@4: #endif //_STLP_EXCEPTION williamr@4: williamr@4: # if (_STLP_OUTERMOST_HEADER_ID == 0x423) williamr@4: # if ! defined (_STLP_DONT_POP_0x423) williamr@4: # include williamr@4: # undef _STLP_OUTERMOST_HEADER_ID williamr@4: # endif williamr@4: # undef _STLP_DONT_POP_0x423 williamr@4: # endif williamr@4: williamr@4: williamr@4: // Local Variables: williamr@4: // mode:C++ williamr@4: // End: williamr@4: williamr@4: williamr@4: