add deprecate and compiler warnings

This commit is contained in:
Rotzbua
2017-05-22 10:04:24 +02:00
parent 7f0f9e7317
commit 8db7e2ba4f
3 changed files with 39 additions and 0 deletions

20
src/deprecated.h Normal file
View File

@@ -0,0 +1,20 @@
/**
* Copyright (c) 2016 by Ludwig Grill (www.rotzbua.de)
* Simple deprecated workaround for Arduino IDE
* IDE 1.6.8 use gcc 4.8 which do not support c++14 [[deprecated]]
* Later versions should support c++14, then use c++14 syntax
*/
#ifndef DEPRECATED_H
#define DEPRECATED_H
#ifdef __has_cpp_attribute
#if __has_cpp_attribute(deprecated)
#define DEPRECATED [[deprecated]]
#define DEPRECATED_MSG(msg) [[deprecated(msg)]]
#endif // __has_cpp_attribute(deprecated)
#else
#define DEPRECATED __attribute__((deprecated))
#define DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
#endif // __has_cpp_attribute
#endif // DEPRECATED_H