Commit 4b807f9e authored by Victor Gao's avatar Victor Gao Committed by Facebook Github Bot

change the definition of FOLLY_MAYBE_UNUSED

Summary:
Currently gcc does not support attributes declared using square brackets well and some builds might break because of this.

Since `__attribute__((...))` works for both clang and gcc, we should switch to it for now.

Reviewed By: yfeldblum

Differential Revision: D5456734

fbshipit-source-id: d7a8bf1389afc5d60604f22d37c93611dc46259c
parent 74102328
...@@ -65,10 +65,8 @@ ...@@ -65,10 +65,8 @@
* #endif * #endif
* } * }
*/ */
#if FOLLY_HAS_CPP_ATTRIBUTE(maybe_unused) #if FOLLY_HAS_CPP_ATTRIBUTE(__unused__)
#define FOLLY_MAYBE_UNUSED [[maybe_unused]] #define FOLLY_MAYBE_UNUSED __attribute__((__unused__))
#elif FOLLY_HAS_CPP_ATTRIBUTE(gnu::unused)
#define FOLLY_MAYBE_UNUSED [[gnu::unused]]
#else #else
#define FOLLY_MAYBE_UNUSED #define FOLLY_MAYBE_UNUSED
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment