[libcxx-dev] build issue on mingw gcc, need some help

Martin Storsjö via libcxx-dev libcxx-dev at lists.llvm.org
Tue Jan 8 23:01:21 PST 2019


On Wed, 9 Jan 2019, Shoaib Meenai wrote:

> 
> I believe you'd want to modify _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS and
> _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS instead, since they're applied to
> explicit instantiation declarations and definitions, respectively.
> _LIBCPP_TEMPLATE_VIS is applied to class templates in general, not explicit
> instantiations specifically.

Yes, that's probably more correct - and the diff ends up neater as well:

diff --git a/include/__config b/include/__config
index b8c2c33..7bdd6b2 100644
--- a/include/__config
+++ b/include/__config
@@ -690,8 +690,13 @@ namespace std {
  #  define _LIBCPP_OVERRIDABLE_FUNC_VIS
  #elif defined(_LIBCPP_BUILDING_LIBRARY)
  #  define _LIBCPP_DLL_VIS __declspec(dllexport)
-#  define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
-#  define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS
+#  if defined(__MINGW32__)
+#    define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS
+#    define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+#  else
+#    define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
+#    define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS
+#  endif
  #  define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_DLL_VIS
  #else
  #  define _LIBCPP_DLL_VIS __declspec(dllimport)


// Martin



More information about the libcxx-dev mailing list