Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -233,15 +233,23 @@ #endif #ifndef _LIBCPP_INLINE_VISIBILITY +#if __has_attribute(internal_linkage) +#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((internal_linkage)) +#else #define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__)) #endif +#endif #ifndef _LIBCPP_EXCEPTION_ABI #define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) #endif #ifndef _LIBCPP_ALWAYS_INLINE -#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__)) +#if __has_attribute(internal_linkage) +#define _LIBCPP_ALWAYS_INLINE __attribute__ ((internal_linkage)) +#else +#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__)) +#endif #endif #if defined(__clang__)