diff options
| author | Shoaib Meenai <smeenai@fb.com> | 2016-09-16 19:12:54 +0000 |
|---|---|---|
| committer | Shoaib Meenai <smeenai@fb.com> | 2016-09-16 19:12:54 +0000 |
| commit | 3b33938c05f1e402f226038f2861e7cce9a5c7fd (patch) | |
| tree | 0fc3a1aa4e3d2e91c41c8bbdbd42fe073f7a99c9 | |
| parent | e04c274e3576616b54682858f2f5611ef444087b (diff) | |
| download | bcm5719-llvm-3b33938c05f1e402f226038f2861e7cce9a5c7fd.tar.gz bcm5719-llvm-3b33938c05f1e402f226038f2861e7cce9a5c7fd.zip | |
[libc++] Fix inline attribute for non-MSVC Windows
gcc and clang in gcc compatibility mode do not accept __forceinline. Use
the gcc attribute for them instead.
Differential Revision: https://reviews.llvm.org/D24678
llvm-svn: 281766
| -rw-r--r-- | libcxx/include/__config | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index 5dd910421dc..e0d2da72ec7 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -560,9 +560,15 @@ namespace std { #define _LIBCPP_TYPE_VIS_ONLY #define _LIBCPP_FUNC_VIS_ONLY #define _LIBCPP_ENUM_VIS -#define _LIBCPP_INLINE_VISIBILITY __forceinline -#define _LIBCPP_ALWAYS_INLINE __forceinline -#define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline +#if defined(_LIBCPP_MSVC) +# define _LIBCPP_INLINE_VISIBILITY __forceinline +# define _LIBCPP_ALWAYS_INLINE __forceinline +# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline +#else +# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__)) +# define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__)) +# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__ ((__always_inline__)) +#endif #endif // _WIN32 #ifndef _LIBCPP_HIDDEN |

