From d7c17041158e89c40bed5560f7c2cfcbb7bb87d1 Mon Sep 17 00:00:00 2001 From: denchat <19730041+denchat@users.noreply.github.com> Date: Tue, 13 Apr 2021 11:31:43 +0700 Subject: [PATCH] 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 --- src/format.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/format.cc b/src/format.cc index 54f4ad45..3a53f3a1 100644 --- a/src/format.cc +++ b/src/format.cc @@ -57,7 +57,7 @@ vformat_to(buffer&, string_view, // Clang doesn't allow dllexport on template instantiation definitions: // https://reviews.llvm.org/D61118. -template struct detail::basic_data; +template struct FMT_INSTANTIATION_DEF_API detail::basic_data; // Workaround a bug in MSVC2013 that prevents instantiation of format_float. int (*instantiate_format_float)(double, int, detail::float_specs,