attributes.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // Copyright Oliver Kowalke 2009.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_COROUTINES_ATTRIBUTES_H
  6. #define BOOST_COROUTINES_ATTRIBUTES_H
  7. #include <cstddef>
  8. #include <boost/config.hpp>
  9. #include <boost/coroutine/flags.hpp>
  10. #include <boost/coroutine/stack_allocator.hpp>
  11. #ifdef BOOST_HAS_ABI_HEADERS
  12. # include BOOST_ABI_PREFIX
  13. #endif
  14. namespace boost {
  15. namespace coroutines {
  16. struct attributes
  17. {
  18. std::size_t size;
  19. flag_unwind_t do_unwind;
  20. flag_fpu_t preserve_fpu;
  21. attributes() BOOST_NOEXCEPT :
  22. size( stack_allocator::default_stacksize() ),
  23. do_unwind( stack_unwind),
  24. preserve_fpu( fpu_preserved)
  25. {}
  26. explicit attributes( std::size_t size_) BOOST_NOEXCEPT :
  27. size( size_),
  28. do_unwind( stack_unwind),
  29. preserve_fpu( fpu_preserved)
  30. {}
  31. explicit attributes( flag_unwind_t do_unwind_) BOOST_NOEXCEPT :
  32. size( stack_allocator::default_stacksize() ),
  33. do_unwind( do_unwind_),
  34. preserve_fpu( fpu_preserved)
  35. {}
  36. explicit attributes( flag_fpu_t preserve_fpu_) BOOST_NOEXCEPT :
  37. size( stack_allocator::default_stacksize() ),
  38. do_unwind( stack_unwind),
  39. preserve_fpu( preserve_fpu_)
  40. {}
  41. explicit attributes(
  42. std::size_t size_,
  43. flag_unwind_t do_unwind_) BOOST_NOEXCEPT :
  44. size( size_),
  45. do_unwind( do_unwind_),
  46. preserve_fpu( fpu_preserved)
  47. {}
  48. explicit attributes(
  49. std::size_t size_,
  50. flag_fpu_t preserve_fpu_) BOOST_NOEXCEPT :
  51. size( size_),
  52. do_unwind( stack_unwind),
  53. preserve_fpu( preserve_fpu_)
  54. {}
  55. explicit attributes(
  56. flag_unwind_t do_unwind_,
  57. flag_fpu_t preserve_fpu_) BOOST_NOEXCEPT :
  58. size( stack_allocator::default_stacksize() ),
  59. do_unwind( do_unwind_),
  60. preserve_fpu( preserve_fpu_)
  61. {}
  62. };
  63. }}
  64. #ifdef BOOST_HAS_ABI_HEADERS
  65. # include BOOST_ABI_SUFFIX
  66. #endif
  67. #endif // BOOST_COROUTINES_ATTRIBUTES_H