config.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. @Copyright Barrett Adair 2016-2017
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  5. */
  6. #ifndef BOOST_CLBL_TRTS_DETAIL_CONFIG_HPP
  7. #define BOOST_CLBL_TRTS_DETAIL_CONFIG_HPP
  8. #include <type_traits>
  9. #include <tuple>
  10. #include <utility>
  11. #include <cstdint>
  12. #define BOOST_CLBL_TRTS_EMPTY_
  13. #define BOOST_CLBL_TRTS_EMPTY BOOST_CLBL_TRTS_EMPTY_
  14. #ifdef __cpp_transactional_memory
  15. # define BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
  16. #endif
  17. #ifdef __cpp_inline_variables
  18. # define BOOST_CLBL_TRAITS_INLINE_VAR inline
  19. #else
  20. # define BOOST_CLBL_TRAITS_INLINE_VAR
  21. #endif
  22. #ifdef __cpp_noexcept_function_type
  23. # define BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
  24. #endif
  25. #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
  26. # define BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER transaction_safe
  27. #else
  28. # define BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
  29. #endif
  30. #ifndef __clang__
  31. # if defined(__GNUC__)
  32. # define BOOST_CLBL_TRTS_GCC
  33. # if __GNUC__ >= 6
  34. # define BOOST_CLBL_TRTS_GCC_AT_LEAST_6_0_0
  35. # endif
  36. # if __GNUC__ < 5
  37. # define BOOST_CLBL_TRTS_GCC_OLDER_THAN_5_0_0
  38. # endif
  39. # if __GNUC__ >= 5
  40. # define BOOST_CLBL_TRTS_GCC_AT_LEAST_4_9_2
  41. # elif __GNUC__ == 4 && __GNUC_MINOR__ == 9 && __GNUC_PATCHLEVEL__ >= 2
  42. # define BOOST_CLBL_TRTS_GCC_AT_LEAST_4_9_2
  43. # else
  44. # define BOOST_CLBL_TRTS_GCC_OLDER_THAN_4_9_2
  45. # endif //#if __GNUC__ >= 5
  46. # endif //#if defined __GNUC__
  47. #endif // #ifndef __clang__
  48. #ifdef _MSC_VER
  49. # ifdef __clang__
  50. # define BOOST_CLBL_TRTS_CLANG_C2
  51. # else
  52. # define BOOST_CLBL_TRTS_MSVC
  53. # endif // #ifdef __clang__
  54. #endif // #ifdef _MSC_VER
  55. #define BOOST_CLBL_TRTS_IX_SEQ(...) ::std::index_sequence< __VA_ARGS__ >
  56. #define BOOST_CLBL_TRTS_MAKE_IX_SEQ(...) ::std::make_index_sequence< __VA_ARGS__ >
  57. #define BOOST_CLBL_TRTS_DISJUNCTION(...) ::std::disjunction< __VA_ARGS__ >
  58. #ifndef __cpp_variable_templates
  59. # define BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
  60. #endif
  61. #ifndef __cpp_lib_logical_traits
  62. # include <boost/callable_traits/detail/polyfills/disjunction.hpp>
  63. #endif //__cpp_lib_logical_traits
  64. #ifndef __cpp_lib_integer_sequence
  65. # include <boost/callable_traits/detail/polyfills/make_index_sequence.hpp>
  66. #endif // __cpp_lib_integer_sequence
  67. #if defined(BOOST_CLBL_TRTS_MSVC) && !defined(BOOST_DISABLE_WIN32)
  68. # define BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC __cdecl
  69. # define BOOST_CLBL_TRTS_PMF_VARGARGS_CDECL_DEFAULT
  70. #else
  71. # define BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
  72. #endif // #if defined(BOOST_CLBL_TRTS_MSVC) && !defined(BOOST_DISABLE_WIN32))
  73. #if (defined(BOOST_CLBL_TRTS_GCC) && !defined(BOOST_CLBL_TRTS_GCC_AT_LEAST_4_9_2)) || defined(__INTEL_COMPILER)
  74. # define BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
  75. # define BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
  76. #endif // #if defined BOOST_CLBL_TRTS_GCC && !defined(BOOST_CLBL_TRTS_GCC_AT_LEAST_4_9_2)
  77. #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
  78. # define BOOST_CLBL_TRTS_ABOMINABLE_CONST BOOST_CLBL_TRTS_EMPTY
  79. # define BOOST_CLBL_TRTS_ABOMINABLE_VOLATILE BOOST_CLBL_TRTS_EMPTY
  80. #else
  81. # define BOOST_CLBL_TRTS_ABOMINABLE_CONST const
  82. # define BOOST_CLBL_TRTS_ABOMINABLE_VOLATILE volatile
  83. #endif // #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
  84. #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
  85. # define BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER noexcept
  86. #else
  87. # define BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER BOOST_CLBL_TRTS_EMPTY
  88. #endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
  89. #endif // #ifndef BOOST_CLBL_TRTS_DETAIL_CONFIG_HPP