clone_current_exception.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //Copyright (c) 2006-2013 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef BOOST_EXCEPTION_81522C0EB56511DFAB613DB0DFD72085
  5. #define BOOST_EXCEPTION_81522C0EB56511DFAB613DB0DFD72085
  6. #ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
  7. #if __GNUC__*100+__GNUC_MINOR__>301
  8. #pragma GCC system_header
  9. #endif
  10. #ifdef __clang__
  11. #pragma clang system_header
  12. #endif
  13. #ifdef _MSC_VER
  14. #pragma warning(push,1)
  15. #endif
  16. #endif
  17. #ifdef BOOST_NO_EXCEPTIONS
  18. # error This header requires exception handling to be enabled.
  19. #endif
  20. namespace
  21. boost
  22. {
  23. namespace
  24. exception_detail
  25. {
  26. class clone_base;
  27. #ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
  28. int clone_current_exception_non_intrusive( clone_base const * & cloned );
  29. #endif
  30. namespace
  31. clone_current_exception_result
  32. {
  33. int const success=0;
  34. int const bad_alloc=1;
  35. int const bad_exception=2;
  36. int const not_supported=3;
  37. }
  38. inline
  39. int
  40. clone_current_exception( clone_base const * & cloned )
  41. {
  42. #ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
  43. return clone_current_exception_non_intrusive(cloned);
  44. #else
  45. return clone_current_exception_result::not_supported;
  46. #endif
  47. }
  48. }
  49. }
  50. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  51. #pragma warning(pop)
  52. #endif
  53. #endif