[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
This commit is contained in:
Shoaib Meenai 2016-09-16 19:12:54 +00:00
parent e04c274e35
commit 3b33938c05
1 changed files with 9 additions and 3 deletions

View File

@ -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