1 //
2 // detail/push_options.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2021 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 
11 // No header guard
12 
13 #if defined(__COMO__)
14 
15 // Comeau C++
16 
17 #elif defined(__DMC__)
18 
19 // Digital Mars C++
20 
21 #elif defined(__INTEL_COMPILER) || defined(__ICL) \
22   || defined(__ICC) || defined(__ECC)
23 
24 // Intel C++
25 
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)
31 
32 #elif defined(__clang__)
33 
34 // Clang
35 
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
41 #     define id cpp_id
42 #     define BOOST_ASIO_OBJC_WORKAROUND
43 #    endif
44 #   endif
45 #  endif
46 # endif
47 
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)
53 
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)
59 
60 # pragma push_macro ("emit")
61 # undef emit
62 
63 # pragma push_macro ("signal")
64 # undef signal
65 
66 # pragma push_macro ("slot")
67 # undef slot
68 
69 #elif defined(__GNUC__)
70 
71 // GNU C++
72 
73 # if defined(__MINGW32__) || defined(__CYGWIN__)
74 #  pragma pack (push, 8)
75 # endif
76 
77 # if defined(__OBJC__)
78 #  if !defined(__APPLE_CC__) || (__APPLE_CC__ <= 1)
79 #   if !defined(BOOST_ASIO_DISABLE_OBJC_WORKAROUND)
80 #    if !defined(Protocol) && !defined(id)
81 #     define Protocol cpp_Protocol
82 #     define id cpp_id
83 #     define BOOST_ASIO_OBJC_WORKAROUND
84 #    endif
85 #   endif
86 #  endif
87 # endif
88 
89 # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
90 #  if !defined(BOOST_ASIO_DISABLE_VISIBILITY)
91 #   pragma GCC visibility push (default)
92 #  endif // !defined(BOOST_ASIO_DISABLE_VISIBILITY)
93 # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
94 
95 # pragma GCC diagnostic push
96 //# pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
97 # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
98 //#  pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
99 # endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
100 # if (__GNUC__ >= 7)
101 //#  pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
102 # endif // (__GNUC__ >= 7)
103 
104 # pragma push_macro ("emit")
105 # undef emit
106 
107 # pragma push_macro ("signal")
108 # undef signal
109 
110 # pragma push_macro ("slot")
111 # undef slot
112 
113 #elif defined(__KCC)
114 
115 // Kai C++
116 
117 #elif defined(__sgi)
118 
119 // SGI MIPSpro C++
120 
121 #elif defined(__DECCXX)
122 
123 // Compaq Tru64 Unix cxx
124 
125 #elif defined(__ghs)
126 
127 // Greenhills C++
128 
129 #elif defined(__BORLANDC__) && !defined(__clang__)
130 
131 // Borland C++
132 
133 # pragma option push -a8 -b -Ve- -Vx- -w-inl -vi-
134 # pragma nopushoptwarn
135 # pragma nopackwarning
136 # if !defined(__MT__)
137 #  error Multithreaded RTL must be selected.
138 # endif // !defined(__MT__)
139 
140 #elif defined(__MWERKS__)
141 
142 // Metrowerks CodeWarrior
143 
144 #elif defined(__SUNPRO_CC)
145 
146 // Sun Workshop Compiler C++
147 
148 #elif defined(__HP_aCC)
149 
150 // HP aCC
151 
152 #elif defined(__MRC__) || defined(__SC__)
153 
154 // MPW MrCpp or SCpp
155 
156 #elif defined(__IBMCPP__)
157 
158 // IBM Visual Age
159 
160 #elif defined(_MSC_VER)
161 
162 // Microsoft Visual C++
163 //
164 // Must remain the last #elif since some other vendors (Metrowerks, for example)
165 // also #define _MSC_VER
166 
167 # pragma warning (disable:4103)
168 # pragma warning (push)
169 # pragma warning (disable:4127)
170 # pragma warning (disable:4180)
171 # pragma warning (disable:4244)
172 # pragma warning (disable:4265)
173 # pragma warning (disable:4355)
174 # pragma warning (disable:4510)
175 # pragma warning (disable:4512)
176 # pragma warning (disable:4610)
177 # pragma warning (disable:4675)
178 # if (_MSC_VER < 1600)
179 // Visual Studio 2008 generates spurious warnings about unused parameters.
180 #  pragma warning (disable:4100)
181 # endif // (_MSC_VER < 1600)
182 # if defined(_M_IX86) && defined(_Wp64)
183 // The /Wp64 option is broken. If you want to check 64 bit portability, use a
184 // 64 bit compiler!
185 #  pragma warning (disable:4311)
186 #  pragma warning (disable:4312)
187 # endif // defined(_M_IX86) && defined(_Wp64)
188 # pragma pack (push, 8)
189 // Note that if the /Og optimisation flag is enabled with MSVC6, the compiler
190 // has a tendency to incorrectly optimise away some calls to member template
191 // functions, even though those functions contain code that should not be
192 // optimised away! Therefore we will always disable this optimisation option
193 // for the MSVC6 compiler.
194 # if (_MSC_VER < 1300)
195 #  pragma optimize ("g", off)
196 # endif
197 # if !defined(_MT)
198 #  error Multithreaded RTL must be selected.
199 # endif // !defined(_MT)
200 
201 # if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
202 #  if !defined(BOOST_ASIO_DISABLE_CLR_WORKAROUND)
203 #   if !defined(generic)
204 #    define generic cpp_generic
205 #    define BOOST_ASIO_CLR_WORKAROUND
206 #   endif
207 #  endif
208 # endif
209 
210 # pragma push_macro ("emit")
211 # undef emit
212 
213 # pragma push_macro ("signal")
214 # undef signal
215 
216 # pragma push_macro ("slot")
217 # undef slot
218 
219 #endif
220