projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0dee398
)
Add a pretty macro for deprecation
author
Ben Maurer
<bmaurer@fb.com>
Wed, 25 Mar 2015 21:33:30 +0000
(14:33 -0700)
committer
Noam Lerner
<noamler@fb.com>
Wed, 25 Mar 2015 22:36:30 +0000
(15:36 -0700)
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
patch
|
blob
|
history
diff --git
a/folly/Portability.h
b/folly/Portability.h
index dd2df1be4110133109e882208995b2d7bb05e02b..9c1cec440162ab3ecc78b3796e0d7720b3126c13 100644
(file)
--- 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)