push_options.hpp 5.4 KB

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