Provide DEPRECATED macro as portable version of [[deprecated]].

The [[deprecated]] attribute is a C++14 feature not supported by MSVC or
GCC < 4.9, but can be simulated on both of these compilers through the
use of alternative (compiler-specific) attribute methods.

Change-Id: I34aed5705db2407c592f7cabd5274358c48d34fe
This commit is contained in:
Peter Johnson
2015-09-23 23:44:54 -07:00
committed by Brad Miller (WPI)
parent ef3fa53fc3
commit f64b055499
17 changed files with 92 additions and 92 deletions

View File

@@ -52,16 +52,16 @@ class Encoder : public SensorBase,
Encoder(std::shared_ptr<DigitalSource> aSource,
std::shared_ptr<DigitalSource> bSource,
bool reverseDirection = false, EncodingType encodingType = k4X);
[[deprecated(
DEPRECATED(
"Raw pointers are deprecated; if you wish to construct your own copy of "
"the DigitalSource and pass it to the constructor, use an "
"std::shared_ptr instead.")]]
"std::shared_ptr instead.")
Encoder(DigitalSource *aSource, DigitalSource *bSource,
bool reverseDirection = false, EncodingType encodingType = k4X);
[[deprecated(
DEPRECATED(
"References are deprecated; if you wish to construct your own copy of "
"the DigitalSource and pass it to the constructor, use an "
"std::shared_ptr instead.")]]
"std::shared_ptr instead.")
Encoder(DigitalSource &aSource, DigitalSource &bSource,
bool reverseDirection = false, EncodingType encodingType = k4X);
virtual ~Encoder();
@@ -86,7 +86,7 @@ class Encoder : public SensorBase,
double PIDGet() override;
void SetIndexSource(uint32_t channel, IndexingType type = kResetOnRisingEdge);
[[deprecated("Raw pointers are deprecated; use references instead.")]]
DEPRECATED("Raw pointers are deprecated; use references instead.")
void SetIndexSource(DigitalSource *source,
IndexingType type = kResetOnRisingEdge);
void SetIndexSource(const DigitalSource &source,