Reimplement DEPRECATED macro with C++ attributes

And prefix it with NDN_CXX_ to avoid name clashes.

Change-Id: I18fd99bbc04a414cbee668936272769dbc4ea761
diff --git a/src/util/backports.hpp b/src/util/backports.hpp
index df1d775..1fd375e 100644
--- a/src/util/backports.hpp
+++ b/src/util/backports.hpp
@@ -40,7 +40,18 @@
 #  define NDN_CXX_HAS_INCLUDE(x) 0
 #endif
 
-#if NDN_CXX_HAS_CPP_ATTRIBUTE(fallthrough)
+#if (__cplusplus >= 201402L) && NDN_CXX_HAS_CPP_ATTRIBUTE(deprecated)
+#  define NDN_CXX_DEPRECATED_MSG(msg) [[deprecated(msg)]]
+#elif NDN_CXX_HAS_CPP_ATTRIBUTE(gnu::deprecated)
+#  define NDN_CXX_DEPRECATED_MSG(msg) [[gnu::deprecated(msg)]]
+#elif defined(__GNUC__)
+#  define NDN_CXX_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
+#else
+#  define NDN_CXX_DEPRECATED_MSG(msg)
+#endif
+#define NDN_CXX_DEPRECATED NDN_CXX_DEPRECATED_MSG("")
+
+#if (__cplusplus > 201402L) && NDN_CXX_HAS_CPP_ATTRIBUTE(fallthrough)
 #  define NDN_CXX_FALLTHROUGH [[fallthrough]]
 #elif NDN_CXX_HAS_CPP_ATTRIBUTE(clang::fallthrough)
 #  define NDN_CXX_FALLTHROUGH [[clang::fallthrough]]