WPILibC++  unspecified
deprecated.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2015. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef DEPRECATED_H_
9 #define DEPRECATED_H_
10 
11 // [[deprecated(msg)]] is a C++14 feature not supported by MSVC or GCC < 4.9.
12 // We provide an equivalent warning implementation for those compilers here.
13 #ifndef WPI_DEPRECATED
14  #if defined(_MSC_VER)
15  #define WPI_DEPRECATED(msg) __declspec(deprecated(msg))
16  #elif defined(__GNUC__)
17  #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)
18  #if __cplusplus > 201103L
19  #define WPI_DEPRECATED(msg) [[deprecated(msg)]]
20  #else
21  #define WPI_DEPRECATED(msg) [[gnu::deprecated(msg)]]
22  #endif
23  #else
24  #define WPI_DEPRECATED(msg) __attribute__((deprecated(msg)))
25  #endif
26  #elif __cplusplus > 201103L
27  #define WPI_DEPRECATED(msg) [[deprecated(msg)]]
28  #else
29  #define WPI_DEPRECATED(msg) /*nothing*/
30  #endif
31 #endif
32 
33 #endif // DEPRECATED_H_