@@ -386,7 +386,7 @@ typedef __char32_t char32_t;
386386# define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
387387# define _LIBCPP_TEMPLATE_VIS
388388# define _LIBCPP_TEMPLATE_DATA_VIS
389- # define _LIBCPP_TYPE_VISIBILITY_DEFAULT
389+ # define _LIBCPP_NAMESPACE_VISIBILITY
390390
391391# else
392392
@@ -414,17 +414,16 @@ typedef __char32_t char32_t;
414414# define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
415415# endif
416416
417- // GCC doesn't support the type_visibility attribute, so we have to keep the visibility attribute on templates
418- # if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && !__has_attribute(__type_visibility__)
419- # define _LIBCPP_TEMPLATE_VIS __attribute__ ((__visibility__(" default" )))
420- # else
421- # define _LIBCPP_TEMPLATE_VIS
422- # endif
417+ // This is kept to avoid a huge library-wide diff in the first step.
418+ // TODO: Remove this in a follow-up patch
419+ # define _LIBCPP_TEMPLATE_VIS
423420
424421# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
425- # define _LIBCPP_TYPE_VISIBILITY_DEFAULT __attribute__ ((__type_visibility__(" default" )))
422+ # define _LIBCPP_NAMESPACE_VISIBILITY __attribute__ ((__type_visibility__(" default" )))
423+ # elif !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
424+ # define _LIBCPP_NAMESPACE_VISIBILITY __attribute__ ((__visibility__(" default" )))
426425# else
427- # define _LIBCPP_TYPE_VISIBILITY_DEFAULT
426+ # define _LIBCPP_NAMESPACE_VISIBILITY
428427# endif
429428
430429# endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)
@@ -583,7 +582,7 @@ typedef __char32_t char32_t;
583582// If it's not clear whether using the unversioned namespace is the correct thing to do, it's not. The versioned
584583// namespace (_LIBCPP_BEGIN_NAMESPACE_STD) should almost always be used.
585584# define _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD \
586- _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std {
585+ _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS namespace _LIBCPP_NAMESPACE_VISIBILITY std {
587586
588587# define _LIBCPP_END_UNVERSIONED_NAMESPACE_STD } _LIBCPP_POP_EXTENSION_DIAGNOSTICS
589588
0 commit comments