From 4b807f9ef3410b33923c6575cc57a667eeb53a76 Mon Sep 17 00:00:00 2001 From: Victor Gao Date: Wed, 19 Jul 2017 16:24:54 -0700 Subject: [PATCH] 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 --- folly/CppAttributes.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/folly/CppAttributes.h b/folly/CppAttributes.h index 542e2718..f1ed1c23 100644 --- a/folly/CppAttributes.h +++ b/folly/CppAttributes.h @@ -65,10 +65,8 @@ * #endif * } */ -#if FOLLY_HAS_CPP_ATTRIBUTE(maybe_unused) -#define FOLLY_MAYBE_UNUSED [[maybe_unused]] -#elif FOLLY_HAS_CPP_ATTRIBUTE(gnu::unused) -#define FOLLY_MAYBE_UNUSED [[gnu::unused]] +#if FOLLY_HAS_CPP_ATTRIBUTE(__unused__) +#define FOLLY_MAYBE_UNUSED __attribute__((__unused__)) #else #define FOLLY_MAYBE_UNUSED #endif -- 2.34.1