dune-common  2.8.0
deprecated.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_DEPRECATED_HH
4 #define DUNE_DEPRECATED_HH
5 
13 #if defined(DOXYGEN) || !defined(HAS_ATTRIBUTE_DEPRECATED)
15 
20 #define DUNE_DEPRECATED
21 #else // defined(HAS_ATTRIBUTE_DEPRECATED)
22 #define DUNE_DEPRECATED __attribute__((deprecated))
23 #endif
24 
25 #if defined(DOXYGEN) || !defined(HAS_ATTRIBUTE_DEPRECATED_MSG)
27 
32 #define DUNE_DEPRECATED_MSG(text) DUNE_DEPRECATED
33 #else // defined(HAS_ATTRIBUTE_DEPRECATED_MSG)
34 #define DUNE_DEPRECATED_MSG(text) __attribute__((deprecated(# text)))
35 #endif
36 
37 #ifdef DOXYGEN
55 #define DUNE_NO_DEPRECATED_BEGIN ...
61 #define DUNE_NO_DEPRECATED_END ...
62 #else
63 # if defined __clang__
64 # define DUNE_NO_DEPRECATED_BEGIN \
65  _Pragma("clang diagnostic push") \
66  _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
67 # define DUNE_NO_DEPRECATED_END _Pragma("clang diagnostic pop")
68 # elif defined __INTEL_COMPILER
69 # define DUNE_NO_DEPRECATED_BEGIN \
70  _Pragma("warning push") \
71  _Pragma("warning(disable:1478)") \
72  _Pragma("warning(disable:1786)")
73 # define DUNE_NO_DEPRECATED_END _Pragma("warning pop")
74 # elif defined __GNUC__
75 # define DUNE_NO_DEPRECATED_BEGIN \
76  _Pragma("GCC diagnostic push") \
77  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
78 # define DUNE_NO_DEPRECATED_END _Pragma("GCC diagnostic pop")
79 # else
80 # define DUNE_NO_DEPRECATED_BEGIN /* Noop. */
81 # define DUNE_NO_DEPRECATED_END /* Noop. */
82 # endif
83 #endif
84 
86 
87 #endif