From: Ben Maurer Date: Wed, 25 Mar 2015 21:33:30 +0000 (-0700) Subject: Add a pretty macro for deprecation X-Git-Tag: v0.32.0~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=014ffabd11e01c1653fb5d2a1d6a83dda138ad76;p=folly.git 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 --- 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)