push_options.hpp 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. //
  2. // detail/push_options.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2025 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. # pragma push_macro ("emit")
  24. # undef emit
  25. # pragma push_macro ("signal")
  26. # undef signal
  27. # pragma push_macro ("slot")
  28. # undef slot
  29. #elif defined(__clang__)
  30. // Clang
  31. # if defined(__OBJC__)
  32. # if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1)
  33. # if !defined(BOOST_ASIO_DISABLE_OBJC_WORKAROUND)
  34. # if !defined(Protocol) && !defined(id)
  35. # define Protocol cpp_Protocol
  36. # define id cpp_id
  37. # define BOOST_ASIO_OBJC_WORKAROUND
  38. # endif
  39. # endif
  40. # endif
  41. # endif
  42. # if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
  43. # if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  44. # pragma GCC visibility push (default)
  45. # endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  46. # endif // !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
  47. # pragma GCC diagnostic push
  48. # pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
  49. # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
  50. # if (__clang_major__ >= 6)
  51. # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  52. # endif // (__clang_major__ >= 6)
  53. # pragma push_macro ("emit")
  54. # undef emit
  55. # pragma push_macro ("signal")
  56. # undef signal
  57. # pragma push_macro ("slot")
  58. # undef slot
  59. #elif defined(__GNUC__)
  60. // GNU C++
  61. # if defined(__MINGW32__) || defined(__CYGWIN__)
  62. # pragma pack (push, 8)
  63. # endif
  64. # if defined(__OBJC__)
  65. # if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1)
  66. # if !defined(BOOST_ASIO_DISABLE_OBJC_WORKAROUND)
  67. # if !defined(Protocol) && !defined(id)
  68. # define Protocol cpp_Protocol
  69. # define id cpp_id
  70. # define BOOST_ASIO_OBJC_WORKAROUND
  71. # endif
  72. # endif
  73. # endif
  74. # endif
  75. # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
  76. # if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  77. # pragma GCC visibility push (default)
  78. # endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
  79. # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
  80. # pragma GCC diagnostic push
  81. # pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
  82. # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
  83. # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  84. # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
  85. # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4)
  86. # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
  87. # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4)
  88. # if (__GNUC__ >= 7)
  89. # pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
  90. # endif // (__GNUC__ >= 7)
  91. # pragma push_macro ("emit")
  92. # undef emit
  93. # pragma push_macro ("signal")
  94. # undef signal
  95. # pragma push_macro ("slot")
  96. # undef slot
  97. #elif defined(__KCC)
  98. // Kai C++
  99. #elif defined(__sgi)
  100. // SGI MIPSpro C++
  101. #elif defined(__DECCXX)
  102. // Compaq Tru64 Unix cxx
  103. #elif defined(__ghs)
  104. // Greenhills C++
  105. #elif defined(__BORLANDC__) && !defined(__clang__)
  106. // Borland C++
  107. # pragma option push -a8 -b -Ve- -Vx- -w-inl -vi-
  108. # pragma nopushoptwarn
  109. # pragma nopackwarning
  110. # if !defined(__MT__)
  111. # error Multithreaded RTL must be selected.
  112. # endif // !defined(__MT__)
  113. #elif defined(__MWERKS__)
  114. // Metrowerks CodeWarrior
  115. #elif defined(__SUNPRO_CC)
  116. // Sun Workshop Compiler C++
  117. #elif defined(__HP_aCC)
  118. // HP aCC
  119. #elif defined(__MRC__) || defined(__SC__)
  120. // MPW MrCpp or SCpp
  121. #elif defined(__IBMCPP__)
  122. // IBM Visual Age
  123. #elif defined(_MSC_VER)
  124. // Microsoft Visual C++
  125. //
  126. // Must remain the last #elif since some other vendors (Metrowerks, for example)
  127. // also #define _MSC_VER
  128. # pragma warning (disable:4103)
  129. # pragma warning (push)
  130. # pragma warning (disable:4619) // suppress 'there is no warning number XXXX'
  131. # pragma warning (disable:4127)
  132. # pragma warning (disable:4180)
  133. # pragma warning (disable:4244)
  134. # pragma warning (disable:4265)
  135. # pragma warning (disable:4355)
  136. # pragma warning (disable:4510)
  137. # pragma warning (disable:4512)
  138. # pragma warning (disable:4610)
  139. # pragma warning (disable:4675)
  140. # pragma warning (disable:4996)
  141. # if (_MSC_VER < 1600)
  142. // Visual Studio 2008 generates spurious warnings about unused parameters.
  143. # pragma warning (disable:4100)
  144. # endif // (_MSC_VER < 1600)
  145. # if defined(_M_IX86) && defined(_Wp64)
  146. // The /Wp64 option is broken. If you want to check 64 bit portability, use a
  147. // 64 bit compiler!
  148. # pragma warning (disable:4311)
  149. # pragma warning (disable:4312)
  150. # endif // defined(_M_IX86) && defined(_Wp64)
  151. # pragma pack (push, 8)
  152. // Note that if the /Og optimisation flag is enabled with MSVC6, the compiler
  153. // has a tendency to incorrectly optimise away some calls to member template
  154. // functions, even though those functions contain code that should not be
  155. // optimised away! Therefore we will always disable this optimisation option
  156. // for the MSVC6 compiler.
  157. # if (_MSC_VER < 1300)
  158. # pragma optimize ("g", off)
  159. # endif
  160. # if !defined(_MT)
  161. # error Multithreaded RTL must be selected.
  162. # endif // !defined(_MT)
  163. # if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
  164. # if !defined(BOOST_ASIO_DISABLE_CLR_WORKAROUND)
  165. # if !defined(generic)
  166. # define generic cpp_generic
  167. # define BOOST_ASIO_CLR_WORKAROUND
  168. # endif
  169. # endif
  170. # endif
  171. # pragma push_macro ("emit")
  172. # undef emit
  173. # pragma push_macro ("signal")
  174. # undef signal
  175. # pragma push_macro ("slot")
  176. # undef slot
  177. #endif