diff --git a/hal/include/HAL/cpp/Semaphore.h b/hal/include/HAL/cpp/Semaphore.h index 140749467e..f5f6f548f1 100644 --- a/hal/include/HAL/cpp/Semaphore.h +++ b/hal/include/HAL/cpp/Semaphore.h @@ -12,8 +12,11 @@ #include #include "HAL/cpp/priority_mutex.h" +#include "support/deprecated.h" -class Semaphore { +class WPI_DEPRECATED( + "Semaphore scheduled for removal in 2018. Recommended to replace with a " + "std::mutex and std::condition_variable") Semaphore { public: explicit Semaphore(int32_t count = 0); Semaphore(Semaphore&&); diff --git a/wpilibc/athena/include/Counter.h b/wpilibc/athena/include/Counter.h index a3fb652ec3..8e333f3646 100644 --- a/wpilibc/athena/include/Counter.h +++ b/wpilibc/athena/include/Counter.h @@ -44,7 +44,7 @@ class Counter : public SensorBase, explicit Counter(int channel); explicit Counter(DigitalSource* source); explicit Counter(std::shared_ptr source); - DEPRECATED("Use pass-by-reference instead.") + WPI_DEPRECATED("Use pass-by-reference instead.") explicit Counter(AnalogTrigger* trigger); explicit Counter(const AnalogTrigger& trigger); Counter(EncodingType encodingType, DigitalSource* upSource, diff --git a/wpilibc/athena/include/Encoder.h b/wpilibc/athena/include/Encoder.h index 31874b9377..8549e83494 100644 --- a/wpilibc/athena/include/Encoder.h +++ b/wpilibc/athena/include/Encoder.h @@ -79,7 +79,7 @@ class Encoder : public SensorBase, double PIDGet() override; void SetIndexSource(int channel, IndexingType type = kResetOnRisingEdge); - DEPRECATED("Use pass-by-reference instead.") + WPI_DEPRECATED("Use pass-by-reference instead.") void SetIndexSource(DigitalSource* source, IndexingType type = kResetOnRisingEdge); void SetIndexSource(const DigitalSource& source, diff --git a/wpilibc/athena/include/Preferences.h b/wpilibc/athena/include/Preferences.h index 2938a35689..b231ec6b22 100644 --- a/wpilibc/athena/include/Preferences.h +++ b/wpilibc/athena/include/Preferences.h @@ -49,7 +49,7 @@ class Preferences : public ErrorBase { void PutFloat(llvm::StringRef key, float value); void PutBoolean(llvm::StringRef key, bool value); void PutLong(llvm::StringRef key, int64_t value); - DEPRECATED( + WPI_DEPRECATED( "Saving is now automatically performed by the NetworkTables server.") void Save(); bool ContainsKey(llvm::StringRef key); diff --git a/wpilibc/athena/include/Task.h b/wpilibc/athena/include/Task.h index f759c3caaf..8acef9d5b9 100644 --- a/wpilibc/athena/include/Task.h +++ b/wpilibc/athena/include/Task.h @@ -12,13 +12,16 @@ #include "ErrorBase.h" #include "HAL/HAL.h" +#include "support/deprecated.h" namespace frc { /** * Wrapper class around std::thread that allows changing thread priority */ -class Task : public ErrorBase { +class WPI_DEPRECATED( + "Task API scheduled for removal in 2018. Replace with std::thread") Task + : public ErrorBase { public: static const int kDefaultPriority = 60; diff --git a/wpilibc/athena/src/Counter.cpp b/wpilibc/athena/src/Counter.cpp index 0002789d8b..ffb8220177 100644 --- a/wpilibc/athena/src/Counter.cpp +++ b/wpilibc/athena/src/Counter.cpp @@ -97,7 +97,7 @@ Counter::Counter(int channel) : Counter(kTwoPulse) { * * @param trigger The pointer to the existing AnalogTrigger object. */ -DEPRECATED("Use pass-by-reference instead.") +WPI_DEPRECATED("Use pass-by-reference instead.") Counter::Counter(AnalogTrigger* trigger) : Counter(kTwoPulse) { SetUpSource(trigger->CreateOutput(AnalogTriggerType::kState)); ClearDownSource(); diff --git a/wpilibc/athena/src/Encoder.cpp b/wpilibc/athena/src/Encoder.cpp index 1738a674ea..c6a2dbdb2b 100644 --- a/wpilibc/athena/src/Encoder.cpp +++ b/wpilibc/athena/src/Encoder.cpp @@ -462,7 +462,7 @@ void Encoder::SetIndexSource(int channel, Encoder::IndexingType type) { * @param channel A digital source to set as the encoder index * @param type The state that will cause the encoder to reset */ -DEPRECATED("Use pass-by-reference instead.") +WPI_DEPRECATED("Use pass-by-reference instead.") void Encoder::SetIndexSource(DigitalSource* source, Encoder::IndexingType type) { SetIndexSource(*source, type); diff --git a/wpilibc/shared/include/Base.h b/wpilibc/shared/include/Base.h index dca199758f..17fafd136c 100644 --- a/wpilibc/shared/include/Base.h +++ b/wpilibc/shared/include/Base.h @@ -29,22 +29,6 @@ #define noexcept throw() #endif -// [[deprecated(msg)]] is a C++14 feature not supported by MSVC or GCC < 4.9. -// We provide an equivalent warning implementation for those compilers here. -#if defined(_MSC_VER) -#define DEPRECATED(msg) __declspec(deprecated(msg)) -#elif defined(__GNUC__) -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8) -#define DEPRECATED(msg) [[deprecated(msg)]] -#else -#define DEPRECATED(msg) __attribute__((deprecated(msg))) -#endif -#elif __cplusplus > 201103L -#define DEPRECATED(msg) [[deprecated(msg)]] -#else -#define DEPRECATED(msg) /*nothing*/ -#endif - // Provide std::decay_t when using GCC < 4.9 #if defined(__GNUC__) #if __GNUC__ == 4 && __GNUC_MINOR__ < 9