Create separate dllexport marking points for clang and msvc. (#2229)

* add FMT_INSTANTIATION_DEF_API for msvc

This should fix https://github.com/fmtlib/fmt/issues/2228

To fix difference dllexport requirements
msvc:  dllexport at template instantiation definition in format.cc
clang: dllexport at template instantiation declaration (extern template) in format.h
This commit is contained in:
denchat
2021-04-17 02:34:18 +07:00
committed by GitHub
parent f4bbc54cc4
commit 52bd62c72f
3 changed files with 16 additions and 3 deletions

View File

@@ -57,7 +57,7 @@ vformat_to(buffer<char>&, string_view,
// Clang doesn't allow dllexport on template instantiation definitions:
// https://reviews.llvm.org/D61118.
template struct detail::basic_data<void>;
template struct FMT_INSTANTIATION_DEF_API detail::basic_data<void>;
// Workaround a bug in MSVC2013 that prevents instantiation of format_float.
int (*instantiate_format_float)(double, int, detail::float_specs,