push_options.hpp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. //
  2. // detail/push_options.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // No header guard
  11. #if defined(__COMO__)
  12. // Comeau C++
  13. #elif defined(__DMC__)
  14. // Digital Mars C++
  15. #elif defined(__INTEL_COMPILER) || defined(__ICL) \
  16. || defined(__ICC) || defined(__ECC)
  17. // Intel C++
  18. # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
  19. # if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  20. # pragma GCC visibility push (default)
  21. # endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  22. # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
  23. #elif defined(__clang__)
  24. // Clang
  25. # if defined(__OBJC__)
  26. # if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1)
  27. # if !defined(BOOST_ASIO_DISABLE_OBJC_WORKAROUND)
  28. # if !defined(Protocol) && !defined(id)
  29. # define Protocol cpp_Protocol
  30. # define id cpp_id
  31. # define BOOST_ASIO_OBJC_WORKAROUND
  32. # endif
  33. # endif
  34. # endif
  35. # endif
  36. # if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
  37. # if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  38. # pragma GCC visibility push (default)
  39. # endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  40. # endif // !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
  41. # pragma GCC diagnostic push
  42. # pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
  43. # if (__clang_major__ >= 6)
  44. # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  45. # endif // (__clang_major__ >= 6)
  46. #elif defined(__GNUC__)
  47. // GNU C++
  48. # if defined(__MINGW32__) || defined(__CYGWIN__)
  49. # pragma pack (push, 8)
  50. # endif
  51. # if defined(__OBJC__)
  52. # if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1)
  53. # if !defined(BOOST_ASIO_DISABLE_OBJC_WORKAROUND)
  54. # if !defined(Protocol) && !defined(id)
  55. # define Protocol cpp_Protocol
  56. # define id cpp_id
  57. # define BOOST_ASIO_OBJC_WORKAROUND
  58. # endif
  59. # endif
  60. # endif
  61. # endif
  62. # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
  63. # if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  64. # pragma GCC visibility push (default)
  65. # endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  66. # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
  67. # pragma GCC diagnostic push
  68. # pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
  69. # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
  70. # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  71. # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
  72. # if (__GNUC__ >= 7)
  73. # pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
  74. # endif // (__GNUC__ >= 7)
  75. #elif defined(__KCC)
  76. // Kai C++
  77. #elif defined(__sgi)
  78. // SGI MIPSpro C++
  79. #elif defined(__DECCXX)
  80. // Compaq Tru64 Unix cxx
  81. #elif defined(__ghs)
  82. // Greenhills C++
  83. #elif defined(__BORLANDC__) && !defined(__clang__)
  84. // Borland C++
  85. # pragma option push -a8 -b -Ve- -Vx- -w-inl -vi-
  86. # pragma nopushoptwarn
  87. # pragma nopackwarning
  88. # if !defined(__MT__)
  89. # error Multithreaded RTL must be selected.
  90. # endif // !defined(__MT__)
  91. #elif defined(__MWERKS__)
  92. // Metrowerks CodeWarrior
  93. #elif defined(__SUNPRO_CC)
  94. // Sun Workshop Compiler C++
  95. #elif defined(__HP_aCC)
  96. // HP aCC
  97. #elif defined(__MRC__) || defined(__SC__)
  98. // MPW MrCpp or SCpp
  99. #elif defined(__IBMCPP__)
  100. // IBM Visual Age
  101. #elif defined(_MSC_VER)
  102. // Microsoft Visual C++
  103. //
  104. // Must remain the last #elif since some other vendors (Metrowerks, for example)
  105. // also #define _MSC_VER
  106. # pragma warning (disable:4103)
  107. # pragma warning (push)
  108. # pragma warning (disable:4127)
  109. # pragma warning (disable:4180)
  110. # pragma warning (disable:4244)
  111. # pragma warning (disable:4355)
  112. # pragma warning (disable:4510)
  113. # pragma warning (disable:4512)
  114. # pragma warning (disable:4610)
  115. # pragma warning (disable:4675)
  116. # if (_MSC_VER < 1600)
  117. // Visual Studio 2008 generates spurious warnings about unused parameters.
  118. # pragma warning (disable:4100)
  119. # endif // (_MSC_VER < 1600)
  120. # if defined(_M_IX86) && defined(_Wp64)
  121. // The /Wp64 option is broken. If you want to check 64 bit portability, use a
  122. // 64 bit compiler!
  123. # pragma warning (disable:4311)
  124. # pragma warning (disable:4312)
  125. # endif // defined(_M_IX86) && defined(_Wp64)
  126. # pragma pack (push, 8)
  127. // Note that if the /Og optimisation flag is enabled with MSVC6, the compiler
  128. // has a tendency to incorrectly optimise away some calls to member template
  129. // functions, even though those functions contain code that should not be
  130. // optimised away! Therefore we will always disable this optimisation option
  131. // for the MSVC6 compiler.
  132. # if (_MSC_VER < 1300)
  133. # pragma optimize ("g", off)
  134. # endif
  135. # if !defined(_MT)
  136. # error Multithreaded RTL must be selected.
  137. # endif // !defined(_MT)
  138. # if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
  139. # if !defined(BOOST_ASIO_DISABLE_CLR_WORKAROUND)
  140. # if !defined(generic)
  141. # define generic cpp_generic
  142. # define BOOST_ASIO_CLR_WORKAROUND
  143. # endif
  144. # endif
  145. # endif
  146. #endif