diff --git a/include/fmt/core.h b/include/fmt/core.h index 5aefcc1498f8f..150517bc4b074 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -185,7 +185,12 @@ # define FMT_CLASS_API #endif #ifndef FMT_API -# define FMT_API +# if defined(_WIN32) +# define FMT_API +# else +# define FMT_API __attribute__((visibility("default"))) +# define FMT_EXTERN_TEMPLATE_API FMT_API +# endif #endif #ifndef FMT_EXTERN_TEMPLATE_API # define FMT_EXTERN_TEMPLATE_API diff --git a/src/format.cc b/src/format.cc index e6fde7c3a35b9..a576b70174a14 100644 --- a/src/format.cc +++ b/src/format.cc @@ -121,7 +121,7 @@ template FMT_API char* internal::sprintf_format(long double, internal::buffer&, sprintf_specs); -template struct FMT_API internal::basic_data; +template struct internal::basic_data; // Workaround a bug in MSVC2013 that prevents instantiation of format_float. int (*instantiate_format_float)(double, int, internal::float_specs,