From 014ffabd11e01c1653fb5d2a1d6a83dda138ad76 Mon Sep 17 00:00:00 2001 From: Ben Maurer Date: Wed, 25 Mar 2015 14:33:30 -0700 Subject: [PATCH] Add a pretty macro for deprecation Summary: Make it easy for people to mark code as deprecated Test Plan: Chose a random file and added the FOLLY_DEPRECATED macro to it Reviewed By: yfeldblum@fb.com Subscribers: ps, folly-diffs@, yfeldblum FB internal diff: D1943248 Signature: t1:1943248:1427316689:b3305d134f374697e93d36bafbf0961eec1ef68a --- folly/Portability.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/folly/Portability.h b/folly/Portability.h index dd2df1be..9c1cec44 100644 --- a/folly/Portability.h +++ b/folly/Portability.h @@ -79,6 +79,13 @@ struct MaxAlign { char c; } __attribute__((__aligned__)); __attribute__((__format__(__printf__, format_param, dots_param))) #endif +// deprecated +#if defined(__clang__) || defined(__GNUC__) +# define FOLLY_DEPRECATED(msg) __attribute__((__deprecated__(msg))) +#else +# define FOLLY_DEPRECATED +#endif + // noreturn #if defined(_MSC_VER) # define FOLLY_NORETURN __declspec(noreturn) -- 2.34.1