1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_range_errors.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_range_errors.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -21,82 +21,77 @@
1.4
1.5 // _STLP_DONT_THROW_RANGE_ERRORS is a hook so that users can disable
1.6 // this exception throwing.
1.7 -#if defined(_STLP_CAN_THROW_RANGE_ERRORS) && defined(_STLP_USE_EXCEPTIONS) \
1.8 - && !defined(_STLP_DONT_THROW_RANGE_ERRORS)
1.9 -# define _STLP_THROW_RANGE_ERRORS
1.10 +#if defined (_STLP_CAN_THROW_RANGE_ERRORS) && defined (_STLP_USE_EXCEPTIONS) && \
1.11 + !defined (_STLP_DONT_THROW_RANGE_ERRORS)
1.12 +# define _STLP_THROW_RANGE_ERRORS
1.13 #endif
1.14
1.15 // For the STLport iostreams, only declaration here, definition is in the lib
1.16 -
1.17 -#if defined ( _STLP_OWN_IOSTREAMS ) && ! defined (_STLP_EXTERN_RANGE_ERRORS)
1.18 +#if !defined (_STLP_USE_NO_IOSTREAMS) && !defined (_STLP_EXTERN_RANGE_ERRORS)
1.19 # define _STLP_EXTERN_RANGE_ERRORS
1.20 -# endif
1.21 -
1.22 -#if defined (_STLP_EXTERN_RANGE_ERRORS)
1.23 -# ifndef _STLP_STDEXCEPT
1.24 -# include <stdexcept>
1.25 -# endif
1.26 -_STLP_BEGIN_NAMESPACE
1.27 -void _STLP_DECLSPEC _STLP_CALL __stl_throw_range_error(const char* __msg);
1.28 -void _STLP_DECLSPEC _STLP_CALL __stl_throw_out_of_range(const char* __msg);
1.29 -void _STLP_DECLSPEC _STLP_CALL __stl_throw_length_error(const char* __msg);
1.30 -void _STLP_DECLSPEC _STLP_CALL __stl_throw_invalid_argument(const char* __msg);
1.31 -void _STLP_DECLSPEC _STLP_CALL __stl_throw_overflow_error(const char* __msg);
1.32 -_STLP_END_NAMESPACE
1.33 -#else
1.34 -
1.35 -#if defined(_STLP_THROW_RANGE_ERRORS)
1.36 -# ifndef _STLP_STDEXCEPT
1.37 -# include <stdexcept>
1.38 -# endif
1.39 -# ifndef _STLP_STRING
1.40 -# include <string>
1.41 -# endif
1.42 -# define _STLP_THROW_MSG(ex,msg) throw ex(string(msg))
1.43 -#else
1.44 -# if defined (_STLP_WINCE)
1.45 -# define _STLP_THROW_MSG(ex,msg) TerminateProcess(GetCurrentProcess(), 0)
1.46 -# else
1.47 -# include <cstdlib>
1.48 -# include <cstdio>
1.49 -# ifdef _STLP_USE_TRAP_LEAVE
1.50 -# define _STLP_THROW_MSG(ex,msg) { STDEX_REPORT_EXCEPTION(msg) ; User::Leave(STDEX_##ex); }
1.51 -# include <stdexcept>
1.52 -# else
1.53 -# define _STLP_THROW_MSG(ex,msg) puts(msg),_STLP_ABORT()
1.54 -# endif
1.55 -# endif
1.56 #endif
1.57
1.58 -// For wrapper mode and throwing range errors, include the
1.59 +_STLP_BEGIN_NAMESPACE
1.60 +void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_runtime_error(const char* __msg);
1.61 +void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_range_error(const char* __msg);
1.62 +void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_out_of_range(const char* __msg);
1.63 +void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_length_error(const char* __msg);
1.64 +void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_invalid_argument(const char* __msg);
1.65 +void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_overflow_error(const char* __msg);
1.66 +_STLP_END_NAMESPACE
1.67 +
1.68 +#if !defined (_STLP_EXTERN_RANGE_ERRORS)
1.69 +
1.70 +# if defined(_STLP_THROW_RANGE_ERRORS)
1.71 +# ifndef _STLP_INTERNAL_STDEXCEPT
1.72 +# include <stl/_stdexcept.h>
1.73 +# endif
1.74 +# ifndef _STLP_STRING
1.75 +# include <string>
1.76 +# endif
1.77 +# define _STLP_THROW_MSG(ex,msg) throw ex(string(msg))
1.78 +# else
1.79 +# if defined (_STLP_RTTI_BUG)
1.80 +# define _STLP_THROW_MSG(ex,msg) TerminateProcess(GetCurrentProcess(), 0)
1.81 +# else
1.82 +# ifndef _STLP_INTERNAL_CSTDLIB
1.83 +# include <stl/_cstdlib.h>
1.84 +# endif
1.85 +# ifndef _STLP_INTERNAL_CSTDIO
1.86 +# include <stl/_cstdio.h>
1.87 +# endif
1.88 +# define _STLP_THROW_MSG(ex,msg) puts(msg),_STLP_ABORT()
1.89 +# endif
1.90 +# endif
1.91 +
1.92 +// For mode without library and throwing range errors, include the
1.93 // stdexcept header and throw the appropriate exceptions directly.
1.94
1.95 _STLP_BEGIN_NAMESPACE
1.96 -inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_range_error(const char* __msg) {
1.97 - _STLP_THROW_MSG(range_error, __msg);
1.98 -}
1.99
1.100 -inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_out_of_range(const char* __msg) {
1.101 - _STLP_THROW_MSG(out_of_range, __msg);
1.102 -}
1.103 +inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_runtime_error(const char* __msg)
1.104 +{ _STLP_THROW_MSG(runtime_error, __msg); }
1.105
1.106 -inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_length_error(const char* __msg) {
1.107 - _STLP_THROW_MSG(length_error, __msg);
1.108 -}
1.109 +inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_range_error(const char* __msg)
1.110 +{ _STLP_THROW_MSG(range_error, __msg); }
1.111
1.112 -inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_invalid_argument(const char* __msg) {
1.113 - _STLP_THROW_MSG(invalid_argument, __msg);
1.114 -}
1.115 +inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_out_of_range(const char* __msg)
1.116 +{ _STLP_THROW_MSG(out_of_range, __msg); }
1.117
1.118 -inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_overflow_error(const char* __msg) {
1.119 - _STLP_THROW_MSG(overflow_error, __msg);
1.120 -}
1.121 +inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_length_error(const char* __msg)
1.122 +{ _STLP_THROW_MSG(length_error, __msg); }
1.123 +
1.124 +inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_invalid_argument(const char* __msg)
1.125 +{ _STLP_THROW_MSG(invalid_argument, __msg); }
1.126 +
1.127 +inline void _STLP_DECLSPEC _STLP_CALL __stl_throw_overflow_error(const char* __msg)
1.128 +{ _STLP_THROW_MSG(overflow_error, __msg); }
1.129 +
1.130 _STLP_END_NAMESPACE
1.131
1.132 -# undef _STLP_THROW_MSG
1.133 +# undef _STLP_THROW_MSG
1.134
1.135 -# endif /* EXTERN_RANGE_ERRORS */
1.136 -
1.137 +#endif /* EXTERN_RANGE_ERRORS */
1.138
1.139 #endif /* _STLP_RANGE_ERRORS_H */
1.140