workaround.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2005-2013. 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_INTRUSIVE_DETAIL_WORKAROUND_HPP
  11. #define BOOST_INTRUSIVE_DETAIL_WORKAROUND_HPP
  12. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #if defined(BOOST_HAS_PRAGMA_ONCE)
  16. # pragma once
  17. #endif
  18. #ifndef BOOST_CONFIG_HPP
  19. #include <boost/config.hpp>
  20. #endif
  21. // MSVC-12 ICEs when variadic templates are enabled.
  22. #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && (!defined(BOOST_MSVC) || BOOST_MSVC >= 1900)
  23. #define BOOST_INTRUSIVE_VARIADIC_TEMPLATES
  24. #endif
  25. #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
  26. #define BOOST_INTRUSIVE_PERFECT_FORWARDING
  27. #endif
  28. //Macros for documentation purposes. For code, expands to the argument
  29. #define BOOST_INTRUSIVE_IMPDEF(TYPE) TYPE
  30. #define BOOST_INTRUSIVE_SEEDOC(TYPE) TYPE
  31. #define BOOST_INTRUSIVE_DOC1ST(TYPE1, TYPE2) TYPE2
  32. #define BOOST_INTRUSIVE_I ,
  33. #define BOOST_INTRUSIVE_DOCIGN(T1) T1
  34. //#define BOOST_INTRUSIVE_DISABLE_FORCEINLINE
  35. #if defined(BOOST_INTRUSIVE_DISABLE_FORCEINLINE)
  36. #define BOOST_INTRUSIVE_FORCEINLINE inline
  37. #elif defined(BOOST_INTRUSIVE_FORCEINLINE_IS_BOOST_FORCELINE)
  38. #define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE
  39. #elif defined(BOOST_MSVC) && defined(_DEBUG)
  40. //"__forceinline" and MSVC seems to have some bugs in debug mode
  41. #define BOOST_INTRUSIVE_FORCEINLINE inline
  42. #elif defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ < 5)))
  43. //Older GCCs have problems with forceinline
  44. #define BOOST_INTRUSIVE_FORCEINLINE inline
  45. #else
  46. #define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE
  47. #endif
  48. #endif //#ifndef BOOST_INTRUSIVE_DETAIL_WORKAROUND_HPP