push_options.hpp 4.5 KB

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