IMP  2.1.0
The Integrative Modeling Platform
base/compiler_macros.h
Go to the documentation of this file.
1 /**
2  * \file IMP/base/compiler_macros.h
3  * \brief Various compiler workarounds
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPBASE_BASE_COMPILER_MACROS_H
9 #define IMPBASE_BASE_COMPILER_MACROS_H
10 
11 #include <boost/detail/endian.hpp>
12 
13 #define IMP_STRINGIFY(x) #x
14 
15 // recommended by http://gcc.gnu.org/gcc/Function-Names.html
16 #if defined(_MSC_VER)
17 #define IMP_CURRENT_FUNCTION __FUNCTION__
18 #define IMP_CURRENT_PRETTY_FUNCTION __FUNCTION__
19 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L
20 #define IMP_CURRENT_FUNCTION __FUNCTION__
21 #define IMP_CURRENT_PRETTY_FUNCTION __PRETTY_FUNCTION__
22 #else
23 #define IMP_CURRENT_FUNCTION __func__
24 #define IMP_CURRENT_PRETTY_FUNCTION __PRETTY_FUNCTION__
25 #endif
26 
27 #ifndef IMP_DOXYGEN
28 #ifdef __GNUC__
29 //! Use this to label a function with no side effects
30 /** \advanced */
31 #define IMP_NO_SIDEEFFECTS __attribute__((pure))
32 //! Use this to make the compiler (possibly) warn if the result is not used
33 /** \advanced */
34 #define IMP_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
35 //! restrict means that a variable is not aliased with this function
36 #define IMP_RESTRICT __restrict__
37 
38 #else
39 #define IMP_NO_SIDEEFFECTS
40 #define IMP_WARN_UNUSED_RESULT
41 #define IMP_RESTRICT
42 #endif
43 
44 #endif
45 
46 #ifdef __clang__
47 #define IMP_COMPILER_HAS_OVERRIDE 1
48 #elif defined(__GNUC__) && __cplusplus >= 201103L
49 // probably should be finer here
50 #define IMP_COMPILER_HAS_OVERRIDE 1
51 #else
52 #define IMP_COMPILER_HAS_OVERRIDE 0
53 #endif
54 
55 #if IMP_COMPILER_HAS_OVERRIDE
56 #define IMP_OVERRIDE override
57 #else
58 #define IMP_OVERRIDE
59 #endif
60 
61 #if defined(IMP_SWIG_WRAPPER)
62 #define IMP_COMPILER_HAS_FINAL 0
63 #elif defined(__clang__)
64 #define IMP_COMPILER_HAS_FINAL 1
65 #elif defined(__GNUC__) && __cplusplus >= 201103L
66 // probably should be finer here
67 #define IMP_COMPILER_HAS_FINAL 1
68 #else
69 #define IMP_COMPILER_HAS_FINAL 0
70 #endif
71 
72 #if IMP_COMPILER_HAS_FINAL
73 #define IMP_FINAL final
74 #else
75 #define IMP_FINAL
76 #endif
77 
78 #if defined(__GNUC__) && __cplusplus >= 201103L
79 #define IMP_HAS_NOEXCEPT 1
80 #elif defined(__clang__) && defined(__has_feature)
81 #define IMP_HAS_NOEXCEPT __has_feature(cxx_noexcept)
82 #else
83 #define IMP_HAS_NOEXCEPT 0
84 #endif
85 
86 #if IMP_HAS_NOEXCEPT
87 #define IMP_NOEXCEPT noexcept
88 #define IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(Name) \
89  Name(const Name &) = default; \
90  Name &operator=(const Name &) = default
91 #else
92 // probably should be finer here
93 #define IMP_NOEXCEPT throw()
94 #define IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(Name)
95 #endif
96 
97 #if defined(__clang__) || defined(__GNUC__)
98 #define IMP_PRAGMA(x) _Pragma(IMP_STRINGIFY(x))
99 
100 #if defined(__clang__)
101 #define IMP_CLANG_PRAGMA(x) IMP_PRAGMA(clang x)
102 #define IMP_GCC_PRAGMA(x)
103 #define IMP_VC_PRAGMA(x)
104 #else
105 #define IMP_CLANG_PRAGMA(x)
106 #define IMP_GCC_PRAGMA(x) IMP_PRAGMA(GCC x)
107 #define IMP_VC_PRAGMA(x)
108 #endif
109 
110 #elif defined(_MSC_VER)
111 #define IMP_PRAGMA(x) __pragma(x)
112 #define IMP_CLANG_PRAGMA(x)
113 #define IMP_GCC_PRAGMA(x)
114 #define IMP_VC_PRAGMA(x) IMP_PRAGMA(x)
115 
116 #else
117 #define IMP_PRAGMA(x)
118 #define IMP_CLANG_PRAGMA(x)
119 #define IMP_GCC_PRAGMA(x)
120 #define IMP_VC_PRAGMA(x)
121 #endif
122 
123 #ifndef IMP_DOXYGEN
124 #if defined(BOOST_LITTLE_ENDIAN)
125 #define IMP_LITTLE_ENDIAN
126 #else
127 #define IMP_BIG_ENDIAN
128 #endif
129 #endif
130 
131 #ifdef __clang__
132 
133 #define IMP_GCC_PUSH_POP(x)
134 
135 #define IMP_COMPILER_ENABLE_WARNINGS \
136  ; \
137  ; \
138  IMP_CLANG_PRAGMA(diagnostic push) \
139  /*IMP_CLANG_PRAGMA( diagnostic warning \
140  "-Wall")*/ \
141  /*IMP_CLANG_PRAGMA( diagnostic warning "-Wextra") */ \
142  IMP_CLANG_PRAGMA(diagnostic warning "-Wabi") \
143  IMP_CLANG_PRAGMA(diagnostic warning "-Waddress-of-temporary") \
144  IMP_CLANG_PRAGMA(diagnostic warning "-Waddress") \
145  IMP_CLANG_PRAGMA(diagnostic warning "-Waggregate-return") \
146  IMP_CLANG_PRAGMA(diagnostic warning "-Wambiguous-member-template") \
147  IMP_CLANG_PRAGMA(diagnostic warning "-Warc-abi") \
148  IMP_CLANG_PRAGMA(diagnostic warning "-Warc-non-pod-memaccess") \
149  IMP_CLANG_PRAGMA(diagnostic warning "-Warc-retain-cycles") \
150  IMP_CLANG_PRAGMA(diagnostic warning "-Warc-unsafe-retained-assign") \
151  IMP_CLANG_PRAGMA(diagnostic warning "-Warc") \
152  IMP_CLANG_PRAGMA(diagnostic warning "-Watomic-properties") \
153  IMP_CLANG_PRAGMA(diagnostic warning "-Wattributes") \
154  IMP_CLANG_PRAGMA(diagnostic warning "-Wavailability") \
155  IMP_CLANG_PRAGMA(diagnostic warning "-Wbad-function-cast") \
156  IMP_CLANG_PRAGMA(diagnostic warning "-Wbind-to-temporary-copy") \
157  IMP_CLANG_PRAGMA(diagnostic warning "-Wbitwise-op-parentheses") \
158  IMP_CLANG_PRAGMA(diagnostic warning "-Wbool-conversions") \
159  IMP_CLANG_PRAGMA(diagnostic warning "-Wbuiltin-macro-redefined") \
160  IMP_CLANG_PRAGMA(diagnostic warning "-Wc++-compat") \
161  IMP_CLANG_PRAGMA(diagnostic warning "-Wc++0x-compat") \
162  IMP_CLANG_PRAGMA(diagnostic ignored "-Wc++11-extensions") \
163  IMP_CLANG_PRAGMA(diagnostic ignored "-Wc++0x-extensions") \
164  IMP_CLANG_PRAGMA(diagnostic warning "-Wcast-align") \
165  IMP_CLANG_PRAGMA(diagnostic warning "-Wcast-qual") \
166  IMP_CLANG_PRAGMA(diagnostic warning "-Wchar-align") \
167  IMP_CLANG_PRAGMA(diagnostic warning "-Wchar-subscripts") \
168  IMP_CLANG_PRAGMA(diagnostic warning "-Wcomment") \
169  IMP_CLANG_PRAGMA(diagnostic warning "-Wcomments") \
170  /* Too many false positives */ \
171  /*IMP_CLANG_PRAGMA( diagnostic warning "-Wconditional-uninitialized")*/ \
172  IMP_CLANG_PRAGMA(diagnostic warning "-Wctor-dtor-privacy") \
173  IMP_CLANG_PRAGMA(diagnostic warning "-Wcustom-atomic-properties") \
174  IMP_CLANG_PRAGMA(diagnostic warning "-Wdeclaration-after-statement") \
175  IMP_CLANG_PRAGMA(diagnostic warning "-Wdefault-arg-special-member") \
176  IMP_CLANG_PRAGMA(diagnostic warning "-Wdelegating-ctor-cycles") \
177  IMP_CLANG_PRAGMA(diagnostic warning "-Wdelete-non-virtual-dtor") \
178  IMP_CLANG_PRAGMA(diagnostic warning "-Wdeprecated-declarations") \
179  IMP_CLANG_PRAGMA(diagnostic warning "-Wdeprecated-implementations") \
180  IMP_CLANG_PRAGMA(diagnostic warning "-Wdeprecated-writable-strings") \
181  IMP_CLANG_PRAGMA(diagnostic warning "-Wdeprecated") \
182  IMP_CLANG_PRAGMA(diagnostic warning "-Wdisabled-optimization") \
183  IMP_CLANG_PRAGMA(diagnostic warning "-Wdiscard-qual") \
184  IMP_CLANG_PRAGMA(diagnostic warning "-Wdiv-by-zero") \
185  IMP_CLANG_PRAGMA(diagnostic warning "-Wduplicate-method-arg") \
186  IMP_CLANG_PRAGMA(diagnostic warning "-Weffc++") \
187  IMP_CLANG_PRAGMA(diagnostic warning "-Wempty-body") \
188  IMP_CLANG_PRAGMA(diagnostic warning "-Wendif-labels") \
189  IMP_CLANG_PRAGMA(diagnostic ignored "-Wexit-time-destructors") \
190  IMP_CLANG_PRAGMA(diagnostic warning "-Wextra-tokens") \
191  IMP_CLANG_PRAGMA(diagnostic warning "-Wformat-extra-args") \
192  IMP_CLANG_PRAGMA(diagnostic warning "-Wformat-nonliteral") \
193  IMP_CLANG_PRAGMA(diagnostic warning "-Wformat-zero-length") \
194  IMP_CLANG_PRAGMA(diagnostic warning "-Wformat") \
195  IMP_CLANG_PRAGMA(diagnostic warning "-Wformat=2") \
196  IMP_CLANG_PRAGMA(diagnostic warning "-Wfour-char-constants") \
197  IMP_CLANG_PRAGMA(diagnostic ignored "-Wglobal-constructors") \
198  IMP_CLANG_PRAGMA(diagnostic warning "-Wgnu-designator") \
199  IMP_CLANG_PRAGMA(diagnostic warning "-Wgnu") \
200  IMP_CLANG_PRAGMA(diagnostic warning "-Wheader-hygiene") \
201  IMP_CLANG_PRAGMA(diagnostic warning "-Widiomatic-parentheses") \
202  IMP_CLANG_PRAGMA(diagnostic warning "-Wignored-qualifiers") \
203  IMP_CLANG_PRAGMA(diagnostic warning "-Wimplicit-atomic-properties") \
204  IMP_CLANG_PRAGMA(diagnostic warning "-Wimplicit-function-declaration") \
205  IMP_CLANG_PRAGMA(diagnostic warning "-Wimplicit-int") \
206  IMP_CLANG_PRAGMA(diagnostic warning "-Wimplicit") \
207  IMP_CLANG_PRAGMA(diagnostic warning "-Wimport") \
208  IMP_CLANG_PRAGMA(diagnostic warning "-Wincompatible-pointer-types") \
209  IMP_CLANG_PRAGMA(diagnostic warning "-Winit-self") \
210  IMP_CLANG_PRAGMA(diagnostic warning "-Winitializer-overrides") \
211  IMP_CLANG_PRAGMA(diagnostic warning "-Winline") \
212  IMP_CLANG_PRAGMA(diagnostic warning "-Wint-to-pointer-cast") \
213  IMP_CLANG_PRAGMA(diagnostic warning "-Winvalid-offsetof") \
214  IMP_CLANG_PRAGMA(diagnostic warning "-Winvalid-pch") \
215  IMP_CLANG_PRAGMA(diagnostic warning "-Wlarge-by-value-copy") \
216  IMP_CLANG_PRAGMA(diagnostic warning "-Wliteral-range") \
217  IMP_CLANG_PRAGMA(diagnostic warning "-Wlocal-type-template-args") \
218  IMP_CLANG_PRAGMA(diagnostic warning "-Wlogical-op-parentheses") \
219  IMP_CLANG_PRAGMA(diagnostic warning "-Wlong-long") \
220  IMP_CLANG_PRAGMA(diagnostic warning "-Wmain") \
221  IMP_CLANG_PRAGMA(diagnostic warning "-Wmicrosoft") \
222  IMP_CLANG_PRAGMA(diagnostic warning "-Wmismatched-tags") \
223  IMP_CLANG_PRAGMA(diagnostic warning "-Wmissing-braces") \
224  IMP_CLANG_PRAGMA(diagnostic warning "-Wmissing-declarations") \
225  IMP_CLANG_PRAGMA(diagnostic warning "-Wmissing-field-initializers") \
226  IMP_CLANG_PRAGMA(diagnostic warning "-Wmissing-format-attribute") \
227  IMP_CLANG_PRAGMA(diagnostic warning "-Wmissing-include-dirs") \
228  IMP_CLANG_PRAGMA(diagnostic ignored "-Wmissing-noreturn") \
229  IMP_CLANG_PRAGMA(diagnostic warning "-Wmost") \
230  IMP_CLANG_PRAGMA(diagnostic warning "-Wmultichar") \
231  IMP_CLANG_PRAGMA(diagnostic warning "-Wnested-externs") \
232  IMP_CLANG_PRAGMA(diagnostic warning "-Wnewline-eof") \
233  IMP_CLANG_PRAGMA(diagnostic warning "-Wnon-gcc") \
234  IMP_CLANG_PRAGMA(diagnostic warning "-Wnon-virtual-dtor") \
235  /*IMP_CLANG_PRAGMA( diagnostic ignored "-Wnonfragile-abi2")*/ \
236  IMP_CLANG_PRAGMA(diagnostic warning "-Wnonnull") \
237  IMP_CLANG_PRAGMA(diagnostic warning "-Wnonportable-cfstrings") \
238  IMP_CLANG_PRAGMA(diagnostic warning "-Wnull-dereference") \
239  IMP_CLANG_PRAGMA(diagnostic warning "-Wobjc-nonunified-exceptions") \
240  IMP_CLANG_PRAGMA(diagnostic warning "-Wold-style-cast") \
241  IMP_CLANG_PRAGMA(diagnostic warning "-Wold-style-definition") \
242  IMP_CLANG_PRAGMA(diagnostic warning "-Wout-of-line-declaration") \
243  IMP_CLANG_PRAGMA(diagnostic warning "-Woverflow") \
244  IMP_CLANG_PRAGMA(diagnostic warning "-Woverlength-strings") \
245  IMP_CLANG_PRAGMA(diagnostic warning "-Woverloaded-virtual") \
246  IMP_CLANG_PRAGMA(diagnostic warning "-Wpacked") \
247  IMP_CLANG_PRAGMA(diagnostic ignored "-Wpadded") \
248  IMP_CLANG_PRAGMA(diagnostic warning "-Wparentheses") \
249  IMP_CLANG_PRAGMA(diagnostic warning "-Wpointer-arith") \
250  IMP_CLANG_PRAGMA(diagnostic warning "-Wpointer-to-int-cast") \
251  IMP_CLANG_PRAGMA(diagnostic warning "-Wprotocol") \
252  IMP_CLANG_PRAGMA(diagnostic warning "-Wreadonly-setter-attrs") \
253  IMP_CLANG_PRAGMA(diagnostic warning "-Wredundant-decls") \
254  IMP_CLANG_PRAGMA(diagnostic warning "-Wreorder") \
255  IMP_CLANG_PRAGMA(diagnostic warning "-Wreturn-type") \
256  IMP_CLANG_PRAGMA(diagnostic warning "-Wself-assign") \
257  IMP_CLANG_PRAGMA(diagnostic warning "-Wsemicolon-before-method-body") \
258  IMP_CLANG_PRAGMA(diagnostic warning "-Wsequence-point") \
259  /* We should turn these on, but there are too may warnings.*/ \
260  /*IMP_CLANG_PRAGMA( diagnostic warning "-Wshadow")*/ \
261  IMP_CLANG_PRAGMA(diagnostic ignored "-Wshorten-64-to-32") \
262  IMP_CLANG_PRAGMA(diagnostic warning "-Wsign-compare") \
263  IMP_CLANG_PRAGMA(diagnostic ignored "-Wsign-conversion") \
264  IMP_CLANG_PRAGMA(diagnostic warning "-Wsign-promo") \
265  IMP_CLANG_PRAGMA(diagnostic warning "-Wsizeof-array-argument") \
266  IMP_CLANG_PRAGMA(diagnostic warning "-Wstack-protector") \
267  IMP_CLANG_PRAGMA(diagnostic warning "-Wstrict-aliasing") \
268  IMP_CLANG_PRAGMA(diagnostic warning "-Wstrict-overflow") \
269  IMP_CLANG_PRAGMA(diagnostic warning "-Wstrict-prototypes") \
270  IMP_CLANG_PRAGMA(diagnostic warning "-Wstrict-selector-match") \
271  IMP_CLANG_PRAGMA(diagnostic warning "-Wsuper-class-method-mismatch") \
272  IMP_CLANG_PRAGMA(diagnostic warning "-Wswitch-default") \
273  /* This is just a dumb warning, provided for gcc compat.*/ \
274  IMP_CLANG_PRAGMA(diagnostic ignored "-Wswitch-enum") \
275  IMP_CLANG_PRAGMA(diagnostic warning "-Wswitch") \
276  IMP_CLANG_PRAGMA(diagnostic warning "-Wsynth") \
277  IMP_CLANG_PRAGMA(diagnostic warning "-Wtautological-compare") \
278  IMP_CLANG_PRAGMA(diagnostic warning "-Wtrigraphs") \
279  IMP_CLANG_PRAGMA(diagnostic warning "-Wtype-limits") \
280  IMP_CLANG_PRAGMA(diagnostic warning "-Wundeclared-selector") \
281  IMP_CLANG_PRAGMA(diagnostic warning "-Wuninitialized") \
282  IMP_CLANG_PRAGMA(diagnostic warning "-Wunknown-pragmas") \
283  IMP_CLANG_PRAGMA(diagnostic warning "-Wunnamed-type-template-args") \
284  IMP_CLANG_PRAGMA(diagnostic warning "-Wunneeded-internal-declaration") \
285  IMP_CLANG_PRAGMA(diagnostic warning "-Wunneeded-member-function") \
286  IMP_CLANG_PRAGMA(diagnostic warning "-Wunused-argument") \
287  IMP_CLANG_PRAGMA(diagnostic warning "-Wunused-exception-parameter") \
288  IMP_CLANG_PRAGMA(diagnostic warning "-Wunused-function") \
289  IMP_CLANG_PRAGMA(diagnostic warning "-Wunused-label") \
290  IMP_CLANG_PRAGMA(diagnostic warning "-Wunused-member-function") \
291  IMP_CLANG_PRAGMA(diagnostic warning "-Wunused-parameter") \
292  IMP_CLANG_PRAGMA(diagnostic warning "-Wunused-value") \
293  IMP_CLANG_PRAGMA(diagnostic warning "-Wunused-variable") \
294  IMP_CLANG_PRAGMA(diagnostic warning "-Wunused") \
295  IMP_CLANG_PRAGMA(diagnostic warning "-Wused-but-marked-unused") \
296  IMP_CLANG_PRAGMA(diagnostic warning "-Wvariadic-macros") \
297  IMP_CLANG_PRAGMA(diagnostic warning "-Wvector-conversions") \
298  IMP_CLANG_PRAGMA(diagnostic warning "-Wvla") \
299  IMP_CLANG_PRAGMA(diagnostic warning "-Wvolatile-register-var") \
300  IMP_CLANG_PRAGMA(diagnostic warning "-Wwrite-strings") \
301  /* Most of these are stupid uses of floats \
302  instead of doubles. I don't needs to be last.*/ \
303  IMP_CLANG_PRAGMA(diagnostic ignored "-Wconversion") \
304  IMP_CLANG_PRAGMA(diagnostic ignored "-Wc++11-compat")
305 
306 #define IMP_HELPER_MACRO_PUSH_WARNINGS \
307  IMP_CLANG_PRAGMA(diagnostic push) \
308  IMP_CLANG_PRAGMA(diagnostic ignored "-Wunused-member-function")
309 
310 #define IMP_HELPER_MACRO_POP_WARNINGS IMP_CLANG_PRAGMA(diagnostic pop)
311 
312 /* IMP_CLANG_PRAGMA( diagnostic warning "-Wall")
313  IMP_CLANG_PRAGMA( diagnostic warning "-Weverything")
314  IMP_CLANG_PRAGMA( diagnostic ignored "-Wpadded")
315  IMP_CLANG_PRAGMA( diagnostic ignored "-Wc++11-extensions")
316  IMP_CLANG_PRAGMA( diagnostic ignored "-Wunknown-pragmas")
317  IMP_CLANG_PRAGMA( diagnostic ignored "-Wc++98-compat")*/
318 
319 #define IMP_COMPILER_DISABLE_WARNINGS \
320  ; \
321  ; \
322  IMP_CLANG_PRAGMA(diagnostic pop)
323 
324 #elif defined(__GNUC__)
325 
326 /*ret+=["-Wno-deprecated",
327  "-Wstrict-aliasing=2",
328  -fno-operator-names",]*/
329 #if __GNUC__ > 4 || __GNUC_MINOR__ >= 6
330 #define IMP_GCC_PUSH_POP(x) IMP_PRAGMA(x)
331 #define IMP_GCC_CXX0X_COMPAT \
332  IMP_GCC_PRAGMA(diagnostic ignored \
333  "-Wc++0x-compa" \
334  "t")
335 #define IMP_GCC_PROTOTYPES \
336  IMP_GCC_PRAGMA(diagnostic warning "-Wmissing-declarations")
337 
338 #define IMP_HELPER_MACRO_PUSH_WARNINGS IMP_GCC_PRAGMA(diagnostic push)
339 
340 #define IMP_HELPER_MACRO_POP_WARNINGS IMP_GCC_PRAGMA(diagnostic pop)
341 
342 #else
343 #define IMP_GCC_PUSH_POP(x)
344 #define IMP_GCC_CXX0X_COMPAT
345 #define IMP_GCC_PROTOTYPES
346 #define IMP_HELPER_MACRO_PUSH_WARNINGS
347 #define IMP_HELPER_MACRO_POP_WARNINGS
348 #endif
349 
350 #define IMP_COMPILER_ENABLE_WARNINGS \
351  ; \
352  ; \
353  IMP_GCC_PUSH_POP(GCC diagnostic push) \
354  IMP_GCC_PRAGMA(diagnostic warning "-Wall") \
355  IMP_GCC_PRAGMA(diagnostic warning "-Wextra") \
356  IMP_GCC_PRAGMA(diagnostic warning "-Winit-self") \
357  IMP_GCC_PRAGMA(diagnostic warning "-Wcast-align") \
358  IMP_GCC_PRAGMA(diagnostic warning "-Woverloaded-virtual") \
359  IMP_GCC_PRAGMA(diagnostic warning "-Wdeprecated-declarations") \
360  IMP_GCC_PRAGMA(diagnostic warning \
361  "-Wundef") IMP_GCC_PROTOTYPES IMP_GCC_CXX0X_COMPAT
362 
363 #define IMP_COMPILER_DISABLE_WARNINGS \
364  ; \
365  ; \
366  IMP_GCC_PUSH_POP(GCC diagnostic pop)
367 
368 #elif defined(_MSC_VER)
369 #define IMP_GCC_PUSH_POP(x)
370 
371 #define IMP_COMPILER_ENABLE_WARNINGS \
372  ; \
373  ; \
374  IMP_VC_PRAGMA(warning(push)) IMP_VC_PRAGMA(warning(disable : 4273))
375 
376 #define IMP_COMPILER_DISABLE_WARNINGS \
377  ; \
378  ; \
379  IMP_VC_PRAGMA(warning(pop))
380 
381 #define IMP_HELPER_MACRO_PUSH_WARNINGS
382 #define IMP_HELPER_MACRO_POP_WARNINGS
383 
384 #else
385 #define IMP_COMPILER_ENABLE_WARNINGS
386 #define IMP_COMPILER_DISABLE_WARNINGS
387 #define IMP_HELPER_MACRO_PUSH_WARNINGS
388 #define IMP_HELPER_MACRO_POP_WARNINGS
389 #endif
390 
391 #if defined(__GNUC__) || defined(__clang__)
392 #define IMP_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
393 #else
394 #define IMP_DEPRECATED_ATTRIBUTE
395 #endif
396 
397 #endif /* IMPBASE_BASE_COMPILER_MACROS_H */