workaround.hpp 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/container for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
  11. #define BOOST_CONTAINER_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. #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)\
  19. && !defined(BOOST_INTERPROCESS_DISABLE_VARIADIC_TMPL)
  20. #define BOOST_CONTAINER_PERFECT_FORWARDING
  21. #endif
  22. #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(__GXX_EXPERIMENTAL_CXX0X__)\
  23. && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40700)
  24. #define BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST
  25. #endif
  26. #if !defined(BOOST_FALLTHOUGH)
  27. #define BOOST_CONTAINER_FALLTHOUGH
  28. #else
  29. #define BOOST_CONTAINER_FALLTHOUGH BOOST_FALLTHOUGH;
  30. #endif
  31. //Macros for documentation purposes. For code, expands to the argument
  32. #define BOOST_CONTAINER_IMPDEF(TYPE) TYPE
  33. #define BOOST_CONTAINER_SEEDOC(TYPE) TYPE
  34. //Macros for memset optimization. In most platforms
  35. //memsetting pointers and floatings is safe and faster.
  36. //
  37. //If your platform does not offer these guarantees
  38. //define these to value zero.
  39. #ifndef BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_NOT_ZERO
  40. #define BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO 1
  41. #endif
  42. #ifndef BOOST_CONTAINER_MEMZEROED_POINTER_IS_NOT_NULL
  43. #define BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL
  44. #endif
  45. #define BOOST_CONTAINER_DOC1ST(TYPE1, TYPE2) TYPE2
  46. #define BOOST_CONTAINER_I ,
  47. #define BOOST_CONTAINER_DOCIGN(T) T
  48. #define BOOST_CONTAINER_DOCONLY(T)
  49. /*
  50. we need to import/export our code only if the user has specifically
  51. asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
  52. libraries to be dynamically linked, or BOOST_CONTAINER_DYN_LINK
  53. if they want just this one to be dynamically liked:
  54. */
  55. #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTAINER_DYN_LINK)
  56. /* export if this is our own source, otherwise import: */
  57. #ifdef BOOST_CONTAINER_SOURCE
  58. # define BOOST_CONTAINER_DECL BOOST_SYMBOL_EXPORT
  59. #else
  60. # define BOOST_CONTAINER_DECL BOOST_SYMBOL_IMPORT
  61. #endif /* BOOST_CONTAINER_SOURCE */
  62. #else
  63. #define BOOST_CONTAINER_DECL
  64. #endif /* DYN_LINK */
  65. //#define BOOST_CONTAINER_DISABLE_FORCEINLINE
  66. #if defined(BOOST_CONTAINER_DISABLE_FORCEINLINE)
  67. #define BOOST_CONTAINER_FORCEINLINE inline
  68. #elif defined(BOOST_CONTAINER_FORCEINLINE_IS_BOOST_FORCELINE)
  69. #define BOOST_CONTAINER_FORCEINLINE BOOST_FORCEINLINE
  70. #elif defined(BOOST_MSVC) && defined(_DEBUG)
  71. //"__forceinline" and MSVC seems to have some bugs in debug mode
  72. #define BOOST_CONTAINER_FORCEINLINE inline
  73. #else
  74. #define BOOST_CONTAINER_FORCEINLINE BOOST_FORCEINLINE
  75. #endif
  76. #endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP