Commit e170172b authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Avoid C++-only attribute in CPortability.h (#1152)

Summary:
- In defining `FOLLY_EXPORT`, we define it differently based on the GCC
  version. In the case of using GCC or Clang 5+, it will rely on
  `[[gnu::visibility("default")]]` which is a C++-specific attribute.
- Since `CPortability.h` is intended to be made to be included for C
  projects, remove `[[gnu::visibility("default")]]` and always define
  `FOLLY_EXPORT` using `__attribute__` syntax which works in C.
Pull Request resolved: https://github.com/facebook/folly/pull/1152

Reviewed By: yfeldblum

Differential Revision: D15618549

Pulled By: Orvid

fbshipit-source-id: fdc72d73f7b38b8a4196cc5677d814544968fb37
parent 23677ce0
......@@ -135,11 +135,7 @@
* Macro for marking functions as having public visibility.
*/
#if defined(__GNUC__)
#if __GNUC_PREREQ(4, 9)
#define FOLLY_EXPORT [[gnu::visibility("default")]]
#else
#define FOLLY_EXPORT __attribute__((__visibility__("default")))
#endif
#else
#define FOLLY_EXPORT
#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