2 // detail/push_options.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
17 #elif defined(__DMC__)
21 #elif defined(__INTEL_COMPILER) || defined(__ICL) \
22 || defined(__ICC) || defined(__ECC)
26 # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
27 # if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
28 # pragma GCC visibility push (default)
29 # endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
30 # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
32 #elif defined(__clang__)
36 # if defined(__OBJC__)
37 # if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1)
38 # if !defined(BOOST_ASIO_DISABLE_OBJC_WORKAROUND)
39 # if !defined(Protocol) && !defined(id)
40 # define Protocol cpp_Protocol
42 # define BOOST_ASIO_OBJC_WORKAROUND
48 # if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
49 # if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
50 # pragma GCC visibility push (default)
51 # endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
52 # endif // !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
54 # pragma GCC diagnostic push
55 # pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
56 # if (__clang_major__ >= 6)
57 # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
58 # endif // (__clang_major__ >= 6)
60 #elif defined(__GNUC__)
64 # if defined(__MINGW32__) || defined(__CYGWIN__)
65 # pragma pack (push, 8)
68 # if defined(__OBJC__)
69 # if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1)
70 # if !defined(BOOST_ASIO_DISABLE_OBJC_WORKAROUND)
71 # if !defined(Protocol) && !defined(id)
72 # define Protocol cpp_Protocol
74 # define BOOST_ASIO_OBJC_WORKAROUND
80 # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
81 # if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
82 # pragma GCC visibility push (default)
83 # endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
84 # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
86 # pragma GCC diagnostic push
87 # pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
88 # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
89 # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
90 # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
92 # pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
93 # endif // (__GNUC__ >= 7)
103 #elif defined(__DECCXX)
105 // Compaq Tru64 Unix cxx
111 #elif defined(__BORLANDC__) && !defined(__clang__)
115 # pragma option push -a8 -b -Ve- -Vx- -w-inl -vi-
116 # pragma nopushoptwarn
117 # pragma nopackwarning
118 # if !defined(__MT__)
119 # error Multithreaded RTL must be selected.
120 # endif // !defined(__MT__)
122 #elif defined(__MWERKS__)
124 // Metrowerks CodeWarrior
126 #elif defined(__SUNPRO_CC)
128 // Sun Workshop Compiler C++
130 #elif defined(__HP_aCC)
134 #elif defined(__MRC__) || defined(__SC__)
138 #elif defined(__IBMCPP__)
142 #elif defined(_MSC_VER)
144 // Microsoft Visual C++
146 // Must remain the last #elif since some other vendors (Metrowerks, for example)
147 // also #define _MSC_VER
149 # pragma warning (disable:4103)
150 # pragma warning (push)
151 # pragma warning (disable:4127)
152 # pragma warning (disable:4180)
153 # pragma warning (disable:4244)
154 # pragma warning (disable:4355)
155 # pragma warning (disable:4510)
156 # pragma warning (disable:4512)
157 # pragma warning (disable:4610)
158 # pragma warning (disable:4675)
159 # if (_MSC_VER < 1600)
160 // Visual Studio 2008 generates spurious warnings about unused parameters.
161 # pragma warning (disable:4100)
162 # endif // (_MSC_VER < 1600)
163 # if defined(_M_IX86) && defined(_Wp64)
164 // The /Wp64 option is broken. If you want to check 64 bit portability, use a
166 # pragma warning (disable:4311)
167 # pragma warning (disable:4312)
168 # endif // defined(_M_IX86) && defined(_Wp64)
169 # pragma pack (push, 8)
170 // Note that if the /Og optimisation flag is enabled with MSVC6, the compiler
171 // has a tendency to incorrectly optimise away some calls to member template
172 // functions, even though those functions contain code that should not be
173 // optimised away! Therefore we will always disable this optimisation option
174 // for the MSVC6 compiler.
175 # if (_MSC_VER < 1300)
176 # pragma optimize ("g", off)
179 # error Multithreaded RTL must be selected.
180 # endif // !defined(_MT)
182 # if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
183 # if !defined(BOOST_ASIO_DISABLE_CLR_WORKAROUND)
184 # if !defined(generic)
185 # define generic cpp_generic
186 # define BOOST_ASIO_CLR_WORKAROUND