5 * Permission to use, copy, modify, distribute and sell this software
6 * and its documentation for any purpose is hereby granted without fee,
7 * provided that the above copyright notice appear in all copies and
8 * that both that copyright notice and this permission notice appear
9 * in supporting documentation. Silicon Graphics makes no
10 * representations about the suitability of this software for any
11 * purpose. It is provided "as is" without express or implied warranty.
15 #if defined(_STLP_THROW_RANGE_ERRORS)
16 # if defined (_STLP_WHOLE_NATIVE_STD) && defined (_STLP_DONT_REDEFINE_STD)
17 // In this mode we are going to throw native exception so that catch of
18 // exception like std::runtime_error for instance will also catch exception
19 // thrown by STLport containers like stlport::vector or stlport::string.
22 # define _STLP_THROW_MSG(ex,msg) throw std::ex(msg)
24 # if defined (__BUILDING_STLPORT)
28 # ifndef _STLP_INTERNAL_STDEXCEPT
29 # include <stl/_stdexcept.h>
31 # ifndef _STLP_INTERNAL_STRING_H
32 # include <stl/_string.h>
35 # define _STLP_THROW_MSG(ex,msg) throw ex(msg)
38 # if defined (__BUILDING_STLPORT)
42 # ifndef _STLP_INTERNAL_CSTDLIB
43 # include <stl/_cstdlib.h>
45 # ifndef _STLP_INTERNAL_CSTDIO
46 # include <stl/_cstdio.h>
49 # define _STLP_THROW_MSG(ex,msg) puts(msg),_STLP_ABORT()
52 // For mode without library and throwing range errors, include the
53 // stdexcept header and throw the appropriate exceptions directly.
55 #if defined (_STLP_EXTERN_RANGE_ERRORS)
56 # define _STLP_THROW_FUNCT_SPEC void _STLP_DECLSPEC
58 # define _STLP_THROW_FUNCT_SPEC inline void
63 _STLP_THROW_FUNCT_SPEC _STLP_CALL
__stl_throw_runtime_error(const char* __msg
)
64 { _STLP_THROW_MSG(runtime_error
, __msg
); }
66 _STLP_THROW_FUNCT_SPEC _STLP_CALL
__stl_throw_range_error(const char* __msg
)
67 { _STLP_THROW_MSG(range_error
, __msg
); }
69 _STLP_THROW_FUNCT_SPEC _STLP_CALL
__stl_throw_out_of_range(const char* __msg
)
70 { _STLP_THROW_MSG(out_of_range
, __msg
); }
72 _STLP_THROW_FUNCT_SPEC _STLP_CALL
__stl_throw_length_error(const char* __msg
)
73 { _STLP_THROW_MSG(length_error
, __msg
); }
75 _STLP_THROW_FUNCT_SPEC _STLP_CALL
__stl_throw_invalid_argument(const char* __msg
)
76 { _STLP_THROW_MSG(invalid_argument
, __msg
); }
78 _STLP_THROW_FUNCT_SPEC _STLP_CALL
__stl_throw_overflow_error(const char* __msg
)
79 { _STLP_THROW_MSG(overflow_error
, __msg
); }
83 #undef _STLP_THROW_FUNCT_SPEC
84 #undef _STLP_THROW_MSG