Drake
drake_deprecated.h
Go to the documentation of this file.
1 #pragma once
2 
7 #ifdef DRAKE_DOXYGEN_CXX
8 
33 #define DRAKE_DEPRECATED(message)
34 
35 #else // DRAKE_DOXYGEN_CXX
36 
37 /* C++14 introduces a standard way to mark deprecated declarations. Before
38 that we can use non-standard compiler hacks. */
39 #ifndef SWIG
40  /* Make sure warnings are enabled in VC++; it is a common Windows hack for
41  programmers to turn them off due to much inconvenient deprecation of useful
42  things by Microsoft. */
43  #if _MSC_VER
44  #pragma warning(default:4996)
45  #endif
46  /* Figure out the best form of deprecation for this compiler. */
47  #if __cplusplus >= 201402L
48  /* C++14 */
49  #define DRAKE_DEPRECATED(MSG) [[deprecated("\nDRAKE DEPRECATED: " MSG)]]
50  #elif _MSC_VER
51  #define DRAKE_DEPRECATED(MSG) \
52  __declspec(deprecated("\nDRAKE DEPRECATED: " MSG))
53  #else /* gcc or clang */
54  #define DRAKE_DEPRECATED(MSG) \
55  __attribute__((deprecated("\nDRAKE DEPRECATED: " MSG)))
56  #endif
57 #else /* Swigging */
58  #define DRAKE_DEPRECATED(MSG)
59 #endif
60 
61 #endif // DRAKE_DOXYGEN_CXX