push_options.hpp 4.1 KB

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