Add a macro that causes GCC and CLANG to emit a warning when
a deprecated macro is used.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
#define __rte_deprecated __attribute__((__deprecated__))
#define __rte_deprecated_msg(msg) __attribute__((__deprecated__(msg)))
+/**
+ * Macro to mark macros and defines scheduled for removal
+ */
+#if defined(RTE_CC_GCC) || defined(RTE_CC_CLANG)
+#define RTE_PRAGMA(x) _Pragma(#x)
+#define RTE_PRAGMA_WARNING(w) RTE_PRAGMA(GCC warning #w)
+#define RTE_DEPRECATED(x) RTE_PRAGMA_WARNING(#x is deprecated)
+#else
+#define RTE_DEPRECATED(x)
+#endif
+
/**
* Mark a function or variable to a weak reference.
*/