clone_current_exception.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 UUID_81522C0EB56511DFAB613DB0DFD72085
  5. #define UUID_81522C0EB56511DFAB613DB0DFD72085
  6. #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  7. #pragma GCC system_header
  8. #endif
  9. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  10. #pragma warning(push,1)
  11. #endif
  12. #ifdef BOOST_NO_EXCEPTIONS
  13. # error This header requires exception handling to be enabled.
  14. #endif
  15. namespace
  16. boost
  17. {
  18. namespace
  19. exception_detail
  20. {
  21. class clone_base;
  22. #ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
  23. int clone_current_exception_non_intrusive( clone_base const * & cloned );
  24. #endif
  25. namespace
  26. clone_current_exception_result
  27. {
  28. int const success=0;
  29. int const bad_alloc=1;
  30. int const bad_exception=2;
  31. int const not_supported=3;
  32. }
  33. inline
  34. int
  35. clone_current_exception( clone_base const * & cloned )
  36. {
  37. #ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
  38. return clone_current_exception_non_intrusive(cloned);
  39. #else
  40. return clone_current_exception_result::not_supported;
  41. #endif
  42. }
  43. }
  44. }
  45. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  46. #pragma warning(pop)
  47. #endif
  48. #endif