_range_errors.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 1999
  3. * Silicon Graphics
  4. *
  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.
  12. *
  13. */
  14. #ifndef _STLP_RANGE_ERRORS_H
  15. #define _STLP_RANGE_ERRORS_H
  16. // A few places in the STL throw range errors, using standard exception
  17. // classes defined in <stdexcept>. This header file provides functions
  18. // to throw those exception objects.
  19. // _STLP_DONT_THROW_RANGE_ERRORS is a hook so that users can disable
  20. // this exception throwing.
  21. #if defined (_STLP_CAN_THROW_RANGE_ERRORS) && defined (_STLP_USE_EXCEPTIONS) && \
  22. !defined (_STLP_DONT_THROW_RANGE_ERRORS)
  23. # define _STLP_THROW_RANGE_ERRORS
  24. #endif
  25. // For the STLport iostreams, only declaration here, definition is in the lib
  26. #if !defined (_STLP_USE_NO_IOSTREAMS) && !defined (_STLP_EXTERN_RANGE_ERRORS)
  27. # define _STLP_EXTERN_RANGE_ERRORS
  28. #endif
  29. _STLP_BEGIN_NAMESPACE
  30. void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_runtime_error(const char* __msg);
  31. void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_range_error(const char* __msg);
  32. void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_out_of_range(const char* __msg);
  33. void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_length_error(const char* __msg);
  34. void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_invalid_argument(const char* __msg);
  35. void _STLP_FUNCTION_THROWS _STLP_DECLSPEC _STLP_CALL __stl_throw_overflow_error(const char* __msg);
  36. #if defined (__DMC__) && !defined (_STLP_NO_EXCEPTIONS)
  37. # pragma noreturn(__stl_throw_runtime_error)
  38. # pragma noreturn(__stl_throw_range_error)
  39. # pragma noreturn(__stl_throw_out_of_range)
  40. # pragma noreturn(__stl_throw_length_error)
  41. # pragma noreturn(__stl_throw_invalid_argument)
  42. # pragma noreturn(__stl_throw_overflow_error)
  43. #endif
  44. _STLP_END_NAMESPACE
  45. #if !defined (_STLP_EXTERN_RANGE_ERRORS)
  46. # include <stl/_range_errors.c>
  47. #endif
  48. #endif /* _STLP_RANGE_ERRORS_H */
  49. // Local Variables:
  50. // mode:C++
  51. // End: