workaround.hpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2014-2014. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/interprocess for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP
  11. #define BOOST_MOVE_DETAIL_WORKAROUND_HPP
  12. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #
  16. #if defined(BOOST_HAS_PRAGMA_ONCE)
  17. # pragma once
  18. #endif
  19. #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
  20. #define BOOST_MOVE_PERFECT_FORWARDING
  21. #endif
  22. #if defined(__has_feature)
  23. #define BOOST_MOVE_HAS_FEATURE __has_feature
  24. #else
  25. #define BOOST_MOVE_HAS_FEATURE(x) 0
  26. #endif
  27. #if BOOST_MOVE_HAS_FEATURE(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
  28. #define BOOST_MOVE_ADDRESS_SANITIZER_ON
  29. #endif
  30. //Macros for documentation purposes. For code, expands to the argument
  31. #define BOOST_MOVE_IMPDEF(TYPE) TYPE
  32. #define BOOST_MOVE_SEEDOC(TYPE) TYPE
  33. #define BOOST_MOVE_DOC0PTR(TYPE) TYPE
  34. #define BOOST_MOVE_DOC1ST(TYPE1, TYPE2) TYPE2
  35. #define BOOST_MOVE_I ,
  36. #define BOOST_MOVE_DOCIGN(T1) T1
  37. #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) && !defined(__clang__)
  38. //Pre-standard rvalue binding rules
  39. #define BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
  40. #elif defined(_MSC_VER) && (_MSC_VER == 1600)
  41. //Standard rvalue binding rules but with some bugs
  42. #define BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
  43. #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
  44. #elif defined(_MSC_VER) && (_MSC_VER == 1700)
  45. #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
  46. #endif
  47. #if defined(BOOST_MOVE_DISABLE_FORCEINLINE)
  48. #define BOOST_MOVE_FORCEINLINE inline
  49. #elif defined(BOOST_MOVE_FORCEINLINE_IS_BOOST_FORCELINE)
  50. #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE
  51. #elif defined(BOOST_MSVC) && defined(_DEBUG)
  52. //"__forceinline" and MSVC seems to have some bugs in debug mode
  53. #define BOOST_MOVE_FORCEINLINE inline
  54. #elif defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ < 5)))
  55. //Older GCCs have problems with forceinline
  56. #define BOOST_MOVE_FORCEINLINE inline
  57. #else
  58. #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE
  59. #endif
  60. #endif //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP