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-13 11:31:43 +07:00 committed by GitHub
parent a1c6bfd77b
commit d7c1704115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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