From 707f3187876b1d26b99417b638640fbc1883cd24 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 7 Mar 2013 19:25:03 +0000 Subject: [PATCH] Change _LIBCPP_TYPE_VIS to use __type_visibility__(default) instead of __visibility__(default) when available. This change makes just the type_info visible so that types like vectors and strings can be used as exception objects across dylib boundaries even when hidden visibility is specified globally (at the command line), and yet this allows clients to hide the member functions of things like vector and string (with global visibility commands). git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176639 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__config | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/__config b/include/__config index ce0858f4..8e39ad60 100644 --- a/include/__config +++ b/include/__config @@ -144,7 +144,11 @@ #endif #ifndef _LIBCPP_TYPE_VIS -#define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) +# if __has_attribute(type_visibility) +# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) +# else +# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) +# endif #endif #ifndef _LIBCPP_INLINE_VISIBILITY @@ -152,7 +156,7 @@ #endif #ifndef _LIBCPP_EXCEPTION_ABI -#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) +#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS #endif #ifndef _LIBCPP_CANTTHROW