Skip to content

Commit

Permalink
add FMT_INSTANTIATION_DEF_API for msvc
Browse files Browse the repository at this point in the history
This should fix fmtlib#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
  • Loading branch information
denchat authored Apr 13, 2021
1 parent a1c6bfd commit d7c1704
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d7c1704

Please sign in to comment.