smeenai created this revision.
smeenai added reviewers: compnerd, EricWF, mclow.lists.
smeenai added a subscriber: cfe-commits.

gcc and clang in gcc compatibility mode do not accept __forceinline. Use
the gcc attribute for them instead.

https://reviews.llvm.org/D24678

Files:
  include/__config

Index: include/__config
===================================================================
--- include/__config
+++ include/__config
@@ -560,9 +560,15 @@
 #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


Index: include/__config
===================================================================
--- include/__config
+++ include/__config
@@ -560,9 +560,15 @@
 #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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to