LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LCIODeprecated.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
7 #ifndef LCIO_DEPRECATED_H
8 #define LCIO_DEPRECATED_H 1
9 
10 #define LCIO_DEFAULT_DEPRECATED(msg, func) func
11 
12 // Helper to deprecate functions and methods
13 // See https://blog.samat.io/2017/02/27/Deprecating-functions-and-methods-in-Cplusplus/
14 // For C++14
15 #if __cplusplus >= 201402L
16  #if defined(__has_cpp_attribute) && __has_cpp_attribute(deprecated)
17  #define LCIO_DEPRECATED(msg, func) [[deprecated(msg)]] func
18  #else
19  #define LCIO_DEPRECATED(msg, func) LCIO_DEFAULT_DEPRECATED(msg, func)
20  #endif
21 // For everyone else
22 #else
23  #ifdef __GNUC__
24  #define LCIO_DEPRECATED(msg, func) func __attribute__ ((deprecated(msg)))
25  #elif defined(_MSC_VER)
26  #define LCIO_DEPRECATED(msg, func) __declspec(deprecated(msg)) func
27  #else
28  #define LCIO_DEPRECATED(msg, func) LCIO_DEFAULT_DEPRECATED(msg, func)
29  #endif
30 #endif
31 
32 #endif // LCIO_DEPRECATED_H