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