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