[libcxx] r176639 - 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).
Howard Hinnant
hhinnant at apple.com
Thu Mar 7 11:25:03 PST 2013
Author: hhinnant
Date: Thu Mar 7 13:25:03 2013
New Revision: 176639
URL: http://llvm.org/viewvc/llvm-project?rev=176639&view=rev
Log:
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).
Modified:
libcxx/trunk/include/__config
Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=176639&r1=176638&r2=176639&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Thu Mar 7 13:25:03 2013
@@ -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
More information about the cfe-commits
mailing list