change the definition of FOLLY_MAYBE_UNUSED
authorVictor Gao <vgao@fb.com>
Wed, 19 Jul 2017 23:24:54 +0000 (16:24 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 19 Jul 2017 23:35:48 +0000 (16:35 -0700)
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

index 542e271811aa49cc9e92af51a6a80b127fedb7ab..f1ed1c23bcf9b9c7beb057e633df82c395090a39 100644 (file)
  *    #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