xlcpp_zos.hpp 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. // Copyright (c) 2017 Dynatrace
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt
  6. // See http://www.boost.org for most recent version.
  7. // Compiler setup for IBM z/OS XL C/C++ compiler.
  8. // Oldest compiler version currently supported is 2.1 (V2R1)
  9. #if !defined(__IBMCPP__) || !defined(__COMPILER_VER__) || __COMPILER_VER__ < 0x42010000
  10. # error "Compiler not supported or configured - please reconfigure"
  11. #endif
  12. #if __COMPILER_VER__ > 0x42010000
  13. # if defined(BOOST_ASSERT_CONFIG)
  14. # error "Unknown compiler version - please run the configure tests and report the results"
  15. # endif
  16. #endif
  17. #define BOOST_COMPILER "IBM z/OS XL C/C++ version " BOOST_STRINGIZE(__COMPILER_VER__)
  18. #define BOOST_XLCPP_ZOS __COMPILER_VER__
  19. // -------------------------------------
  20. #include <features.h> // For __UU, __C99, __TR1, ...
  21. #if !defined(__IBMCPP_DEFAULTED_AND_DELETED_FUNCTIONS)
  22. # define BOOST_NO_CXX11_DELETED_FUNCTIONS
  23. # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
  24. # define BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
  25. #endif
  26. // -------------------------------------
  27. #if defined(__UU) || defined(__C99) || defined(__TR1)
  28. # define BOOST_HAS_LOG1P
  29. # define BOOST_HAS_EXPM1
  30. #endif
  31. #if defined(__C99) || defined(__TR1)
  32. # define BOOST_HAS_STDINT_H
  33. #else
  34. # define BOOST_NO_FENV_H
  35. #endif
  36. // -------------------------------------
  37. #define BOOST_HAS_NRVO
  38. #if !defined(__RTTI_ALL__)
  39. # define BOOST_NO_RTTI
  40. #endif
  41. #if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS)
  42. # define BOOST_NO_EXCEPTIONS
  43. #endif
  44. #if defined(_LONG_LONG) || defined(__IBMCPP_C99_LONG_LONG) || defined(__LL)
  45. # define BOOST_HAS_LONG_LONG
  46. #else
  47. # define BOOST_NO_LONG_LONG
  48. #endif
  49. #if defined(_LONG_LONG) || defined(__IBMCPP_C99_LONG_LONG) || defined(__LL) || defined(_LP64)
  50. # define BOOST_HAS_MS_INT64
  51. #endif
  52. #define BOOST_NO_SFINAE_EXPR
  53. #define BOOST_NO_CXX11_SFINAE_EXPR
  54. #if defined(__IBMCPP_VARIADIC_TEMPLATES)
  55. # define BOOST_HAS_VARIADIC_TMPL
  56. #else
  57. # define BOOST_NO_CXX11_VARIADIC_TEMPLATES
  58. # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
  59. #endif
  60. #if defined(__IBMCPP_STATIC_ASSERT)
  61. # define BOOST_HAS_STATIC_ASSERT
  62. #else
  63. # define BOOST_NO_CXX11_STATIC_ASSERT
  64. #endif
  65. #if defined(__IBMCPP_RVALUE_REFERENCES)
  66. # define BOOST_HAS_RVALUE_REFS
  67. #else
  68. # define BOOST_NO_CXX11_RVALUE_REFERENCES
  69. #endif
  70. #if !defined(__IBMCPP_SCOPED_ENUM)
  71. # define BOOST_NO_CXX11_SCOPED_ENUMS
  72. #endif
  73. #define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
  74. #define BOOST_NO_CXX11_TEMPLATE_ALIASES
  75. #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
  76. #if !defined(__IBMCPP_EXPLICIT_CONVERSION_OPERATORS)
  77. # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
  78. #endif
  79. #if !defined(__IBMCPP_DECLTYPE)
  80. # define BOOST_NO_CXX11_DECLTYPE
  81. #else
  82. # define BOOST_HAS_DECLTYPE
  83. #endif
  84. #define BOOST_NO_CXX11_DECLTYPE_N3276
  85. #if !defined(__IBMCPP_INLINE_NAMESPACE)
  86. # define BOOST_NO_CXX11_INLINE_NAMESPACES
  87. #endif
  88. #if !defined(__IBMCPP_AUTO_TYPEDEDUCTION)
  89. # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
  90. # define BOOST_NO_CXX11_AUTO_DECLARATIONS
  91. # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
  92. #endif
  93. #if !defined(__IBM_CHAR32_T__)
  94. # define BOOST_NO_CXX11_CHAR32_T
  95. #endif
  96. #if !defined(__IBM_CHAR16_T__)
  97. # define BOOST_NO_CXX11_CHAR16_T
  98. #endif
  99. #if !defined(__IBMCPP_CONSTEXPR)
  100. # define BOOST_NO_CXX11_CONSTEXPR
  101. #endif
  102. #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
  103. #define BOOST_NO_CXX11_UNICODE_LITERALS
  104. #define BOOST_NO_CXX11_RAW_LITERALS
  105. #define BOOST_NO_CXX11_RANGE_BASED_FOR
  106. #define BOOST_NO_CXX11_NULLPTR
  107. #define BOOST_NO_CXX11_NOEXCEPT
  108. #define BOOST_NO_CXX11_LAMBDAS
  109. #define BOOST_NO_CXX11_USER_DEFINED_LITERALS
  110. #define BOOST_NO_CXX11_THREAD_LOCAL
  111. #define BOOST_NO_CXX11_REF_QUALIFIERS
  112. #define BOOST_NO_CXX11_FINAL
  113. #define BOOST_NO_CXX11_ALIGNAS
  114. #define BOOST_NO_CXX14_VARIABLE_TEMPLATES
  115. #define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
  116. #define BOOST_NO_CXX14_AGGREGATE_NSDMI
  117. #define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
  118. #define BOOST_NO_CXX14_GENERIC_LAMBDAS
  119. #define BOOST_NO_CXX14_DIGIT_SEPARATORS
  120. #define BOOST_NO_CXX14_DECLTYPE_AUTO
  121. #define BOOST_NO_CXX14_CONSTEXPR
  122. #define BOOST_NO_CXX14_BINARY_LITERALS
  123. #define BOOST_NO_CXX17_STRUCTURED_BINDINGS
  124. #define BOOST_NO_CXX17_INLINE_VARIABLES
  125. #define BOOST_NO_CXX17_FOLD_EXPRESSIONS
  126. #define BOOST_NO_CXX17_IF_CONSTEXPR
  127. // -------------------------------------
  128. #if defined(__IBM_ATTRIBUTES)
  129. # define BOOST_FORCEINLINE inline __attribute__ ((__always_inline__))
  130. # define BOOST_NOINLINE __attribute__ ((__noinline__))
  131. # define BOOST_MAY_ALIAS __attribute__((__may_alias__))
  132. // No BOOST_ALIGNMENT - explicit alignment support is broken (V2R1).
  133. #endif
  134. extern "builtin" long __builtin_expect(long, long);
  135. #define BOOST_LIKELY(x) __builtin_expect((x) && true, 1)
  136. #define BOOST_UNLIKELY(x) __builtin_expect((x) && true, 0)