Commit eb8f3c3c authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Explicitly handle gcc in FOLLY_MAYBE_UNUSED

Summary:
[Folly] Explicitly handle gcc in `FOLLY_MAYBE_UNUSED`.

Fixes build break from {D5562220}.

Reviewed By: Orvid

Differential Revision: D5594288

fbshipit-source-id: 5aa2dcb6133d53a0eb20d34b67c8e4407dd2b7ca
parent 13f2e056
...@@ -22,6 +22,12 @@ ...@@ -22,6 +22,12 @@
#pragma once #pragma once
#ifndef __has_attribute
#define FOLLY_HAS_ATTRIBUTE(x) 0
#else
#define FOLLY_HAS_ATTRIBUTE(x) __has_attribute(x)
#endif
#ifndef __has_cpp_attribute #ifndef __has_cpp_attribute
#define FOLLY_HAS_CPP_ATTRIBUTE(x) 0 #define FOLLY_HAS_CPP_ATTRIBUTE(x) 0
#else #else
...@@ -65,7 +71,9 @@ ...@@ -65,7 +71,9 @@
* #endif * #endif
* } * }
*/ */
#if FOLLY_HAS_CPP_ATTRIBUTE(__unused__) #if FOLLY_HAS_CPP_ATTRIBUTE(maybe_unused)
#define FOLLY_MAYBE_UNUSED [[maybe_unused]]
#elif FOLLY_HAS_ATTRIBUTE(__unused__) || __GNUC__
#define FOLLY_MAYBE_UNUSED __attribute__((__unused__)) #define FOLLY_MAYBE_UNUSED __attribute__((__unused__))
#else #else
#define FOLLY_MAYBE_UNUSED #define FOLLY_MAYBE_UNUSED
......
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