push_options.hpp 5.2 KB

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