diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -554,12 +554,14 @@ # endif // defined(_LIBCPP_OBJECT_FORMAT_COFF) +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +# define _LIBCPP_VISIBILITY(vis) __attribute__((__visibility__(vis))) +# else +# define _LIBCPP_VISIBILITY(vis) +# endif + # ifndef _LIBCPP_HIDDEN -# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -# define _LIBCPP_HIDDEN __attribute__((__visibility__("hidden"))) -# else -# define _LIBCPP_HIDDEN -# endif +# define _LIBCPP_HIDDEN _LIBCPP_VISIBILITY("hidden") # endif # ifndef _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS @@ -572,19 +574,11 @@ # endif # ifndef _LIBCPP_FUNC_VIS -# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -# define _LIBCPP_FUNC_VIS __attribute__((__visibility__("default"))) -# else -# define _LIBCPP_FUNC_VIS -# endif +# define _LIBCPP_FUNC_VIS _LIBCPP_VISIBILITY("default") # endif # ifndef _LIBCPP_TYPE_VIS -# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -# define _LIBCPP_TYPE_VIS __attribute__((__visibility__("default"))) -# else -# define _LIBCPP_TYPE_VIS -# endif +# define _LIBCPP_TYPE_VIS _LIBCPP_VISIBILITY("default") # endif # ifndef _LIBCPP_TEMPLATE_VIS @@ -600,19 +594,11 @@ # endif # ifndef _LIBCPP_TEMPLATE_DATA_VIS -# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -# define _LIBCPP_TEMPLATE_DATA_VIS __attribute__((__visibility__("default"))) -# else -# define _LIBCPP_TEMPLATE_DATA_VIS -# endif +# define _LIBCPP_TEMPLATE_DATA_VIS _LIBCPP_VISIBILITY("default") # endif # ifndef _LIBCPP_EXPORTED_FROM_ABI -# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -# define _LIBCPP_EXPORTED_FROM_ABI __attribute__((__visibility__("default"))) -# else -# define _LIBCPP_EXPORTED_FROM_ABI -# endif +# define _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_VISIBILITY("default") # endif # ifndef _LIBCPP_OVERRIDABLE_FUNC_VIS @@ -620,11 +606,7 @@ # endif # ifndef _LIBCPP_EXCEPTION_ABI -# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -# define _LIBCPP_EXCEPTION_ABI __attribute__((__visibility__("default"))) -# else -# define _LIBCPP_EXCEPTION_ABI -# endif +# define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBILITY("default") # endif # ifndef _LIBCPP_ENUM_VIS @@ -636,11 +618,7 @@ # endif # ifndef _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS -# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __attribute__((__visibility__("default"))) -# else -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS -# endif +# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_VISIBILITY("default") # endif # ifndef _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS @@ -925,8 +903,8 @@ # endif # ifndef _LIBCPP_HAS_NO_ASAN -extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(const void*, const void*, const void*, - const void*); + extern "C" _LIBCPP_FUNC_VIS void + __sanitizer_annotate_contiguous_container(const void*, const void*, const void*, const void*); # endif // Try to find out if RTTI is disabled.