config.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright Oliver Kowalke 2013.
  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_FIBERS_DETAIL_CONFIG_H
  6. #define BOOST_FIBERS_DETAIL_CONFIG_H
  7. #include <cstddef>
  8. #include <boost/config.hpp>
  9. #include <boost/predef.h>
  10. #include <boost/detail/workaround.hpp>
  11. #ifdef BOOST_FIBERS_DECL
  12. # undef BOOST_FIBERS_DECL
  13. #endif
  14. #if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FIBERS_DYN_LINK) ) && ! defined(BOOST_FIBERS_STATIC_LINK)
  15. # if defined(BOOST_FIBERS_SOURCE)
  16. # define BOOST_FIBERS_DECL BOOST_SYMBOL_EXPORT
  17. # define BOOST_FIBERS_BUILD_DLL
  18. # else
  19. # define BOOST_FIBERS_DECL BOOST_SYMBOL_IMPORT
  20. # endif
  21. #endif
  22. #if ! defined(BOOST_FIBERS_DECL)
  23. # define BOOST_FIBERS_DECL
  24. #endif
  25. #if ! defined(BOOST_FIBERS_SOURCE) && ! defined(BOOST_ALL_NO_LIB) && ! defined(BOOST_FIBERS_NO_LIB)
  26. # define BOOST_LIB_NAME boost_fiber
  27. # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FIBERS_DYN_LINK)
  28. # define BOOST_DYN_LINK
  29. # endif
  30. # include <boost/config/auto_link.hpp>
  31. #endif
  32. #if BOOST_OS_LINUX || BOOST_OS_WINDOWS
  33. # define BOOST_FIBERS_HAS_FUTEX
  34. #endif
  35. #if (!defined(BOOST_FIBERS_HAS_FUTEX) && \
  36. (defined(BOOST_FIBERS_SPINLOCK_TTAS_FUTEX) || defined(BOOST_FIBERS_SPINLOCK_TTAS_ADAPTIVE_FUTEX)))
  37. # error "futex not supported on this platform"
  38. #endif
  39. #if !defined(BOOST_FIBERS_CONTENTION_WINDOW_THRESHOLD)
  40. # define BOOST_FIBERS_CONTENTION_WINDOW_THRESHOLD 16
  41. #endif
  42. #if !defined(BOOST_FIBERS_RETRY_THRESHOLD)
  43. # define BOOST_FIBERS_RETRY_THRESHOLD 64
  44. #endif
  45. #if !defined(BOOST_FIBERS_SPIN_BEFORE_SLEEP0)
  46. # define BOOST_FIBERS_SPIN_BEFORE_SLEEP0 32
  47. #endif
  48. #if !defined(BOOST_FIBERS_SPIN_BEFORE_YIELD)
  49. # define BOOST_FIBERS_SPIN_BEFORE_YIELD 64
  50. #endif
  51. #endif // BOOST_FIBERS_DETAIL_CONFIG_H