WPILibC++ 2024.3.2
deprecated.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#ifndef WPIUTIL_WPI_DEPRECATED_H_
6#define WPIUTIL_WPI_DEPRECATED_H_
7
8#ifndef WPI_DEPRECATED
9#define WPI_DEPRECATED(msg) [[deprecated(msg)]]
10#endif
11
12#ifndef WPI_IGNORE_DEPRECATED
13#ifdef __GNUC__
14#define WPI_IGNORE_DEPRECATED \
15 _Pragma("GCC diagnostic push") \
16 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
17#elif defined(_WIN32)
18#define WPI_IGNORE_DEPRECATED _Pragma("warning(disable : 4996)")
19#else
20#define WPI_IGNORE_DEPRECATED
21#endif
22
23#endif
24
25#ifndef WPI_UNIGNORE_DEPRECATED
26#ifdef __GNUC__
27#define WPI_UNIGNORE_DEPRECATED _Pragma("GCC diagnostic pop")
28#elif defined(_WIN32)
29#define WPI_UNIGNORE_DEPRECATED _Pragma("warning(default : 4996)")
30#else
31#define WPI_UNIGNORE_DEPRECATED
32#endif
33#endif
34
35#endif // WPIUTIL_WPI_DEPRECATED_H_