Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -548,15 +548,16 @@ #ifdef _WIN32 -// only really useful for a DLL. _LIBCPP_DLL should be a compiler builtin define ideally... -#if defined(_LIBCPP_DLL) && defined(cxx_EXPORTS) +#if !defined(_LIBCPP_STATIC_BUILD) +#if defined(cxx_EXPORTS) # define _LIBCPP_DLL_VIS __declspec(dllexport) # define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS # define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS -#elif defined(_LIBCPP_DLL) +#else # define _LIBCPP_DLL_VIS __declspec(dllimport) # define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS # define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS +#endif #else # define _LIBCPP_DLL_VIS # define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS