[core] restore NS_DEPRECATED functionality

This commit is contained in:
Peter D. Barnes, Jr.
2016-09-02 21:46:31 -04:00
parent 84cd2d224c
commit 25c02db88c
2 changed files with 15 additions and 4 deletions

View File

@@ -30,7 +30,7 @@
* \deprecated This method will go away in future versions of ns-3.
* See instead TheNewWay()
*/
void SomethingUseful (void);
NS_DEPRECATED(void SomethingUseful (void) );
/*
* Do something more useful.
*/

View File

@@ -41,10 +41,21 @@
* \snippet src/core/doc/deprecated-example.h doxygen snippet
*/
#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ > 1)
#define NS_DEPRECATED __attribute__ ((deprecated))
#if defined(__GNUC__)
/* Test for GCC >= 4.1 */
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
#if (GCC_VERSION >= 40100)
#define NS_DEPRECATED(x) x __attribute__ ((deprecated))
#endif
#undef GCC_VERSION
#elif defined(__clang__) || defined(__llvm__)
#define NS_DEPRECATED(x) x __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define NS_DEPRECATED __declspec(deprecated) x
#else
#define NS_DEPRECATED
#define NS_DEPRECATED(x) x
#endif
#endif /* NS3_DEPRECATED_H */