~smspillaz/folly/folly-git-master

« back to all changes in this revision

Viewing changes to folly/CPortability.h

  • Committer: Facebook Github Bot
  • Author(s): Joe Loser
  • Date: 2019-04-19 23:54:22 UTC
  • Revision ID: git-v1:6607a5012db1db9d61e6ea8596706676b9bed390
Simplify some macros testing __GNUC__ and __clang__ (#1095)

Summary:
- Both GCC and Clang define the macro `__GNUC__`, `__GNUG__` and
  friends. Simplify some macros whose intent is to check "if we are GCC or
  Clang" but do so via checking `__GNUC__` in addition to `__clang__`. It
  is sufficient to just check `__GNUC__`.
Pull Request resolved: https://github.com/facebook/folly/pull/1095

Reviewed By: Orvid

Differential Revision: D14697480

Pulled By: yfeldblum

fbshipit-source-id: cd6ec82c4235a1321ecdf240afaad7d5c0e99437

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
// noinline
148
148
#ifdef _MSC_VER
149
149
#define FOLLY_NOINLINE __declspec(noinline)
150
 
#elif defined(__clang__) || defined(__GNUC__)
 
150
#elif defined(__GNUC__)
151
151
#define FOLLY_NOINLINE __attribute__((__noinline__))
152
152
#else
153
153
#define FOLLY_NOINLINE
156
156
// always inline
157
157
#ifdef _MSC_VER
158
158
#define FOLLY_ALWAYS_INLINE __forceinline
159
 
#elif defined(__clang__) || defined(__GNUC__)
 
159
#elif defined(__GNUC__)
160
160
#define FOLLY_ALWAYS_INLINE inline __attribute__((__always_inline__))
161
161
#else
162
162
#define FOLLY_ALWAYS_INLINE inline
165
165
// attribute hidden
166
166
#if _MSC_VER
167
167
#define FOLLY_ATTR_VISIBILITY_HIDDEN
168
 
#elif defined(__clang__) || defined(__GNUC__)
 
168
#elif defined(__GNUC__)
169
169
#define FOLLY_ATTR_VISIBILITY_HIDDEN __attribute__((__visibility__("hidden")))
170
170
#else
171
171
#define FOLLY_ATTR_VISIBILITY_HIDDEN