]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Add ATTR_DEPRECATED macro
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 21 Apr 2018 13:19:43 +0000 (16:19 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 30 Aug 2018 08:15:52 +0000 (11:15 +0300)
src/lib/compat.h
src/lib/macros.h

index d287b6572ced99e19173c1a064e43daead669f54..dbda02f809cd8278856da4e4853898921b4e6504 100644 (file)
@@ -27,6 +27,7 @@
 
 #if (defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) || \
     (defined(__clang__) && (__has_extension(attribute_deprecated_with_message)))
+#  define HAVE_ATTR_DEPRECATED
 int rand(void) __attribute__((deprecated("Do not use rand, use i_rand")));
 int rand_r(unsigned int*) __attribute__((deprecated("Do not use rand_r, use i_rand")));
 #endif
index eec7cd2f02c3db510b1d1eb295c61d9927db64a5..6924b3c145ed72795b3c3414f09a06a29382762f 100644 (file)
 #else
 #  define ATTR_RETURNS_NONNULL
 #endif
+#ifdef HAVE_ATTR_DEPRECATED
+#  define ATTR_DEPRECATED(str) __attribute__((deprecated(str)))
+#else
+#  define ATTR_DEPRECATED(str)
+#endif
 
 /* Macros to provide type safety for callback functions' context parameters */
 #ifdef HAVE_TYPE_CHECKS