diff --git a/include/fmt/core.h b/include/fmt/core.h index 4c142816..f5cd2a8f 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -39,6 +39,16 @@ # define FMT_MSC_VER 0 #endif +#ifndef FMT_OVERRIDE +# if FMT_HAS_FEATURE(cxx_override) || \ + (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || \ + FMT_MSC_VER >= 1900 +# define FMT_OVERRIDE override +# else +# define FMT_OVERRIDE +# endif +#endif + #ifndef FMT_NULL # if FMT_HAS_FEATURE(cxx_nullptr) || \ (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || \ diff --git a/include/fmt/format.cc b/include/fmt/format.cc index 57f68185..e41f2cba 100644 --- a/include/fmt/format.cc +++ b/include/fmt/format.cc @@ -437,11 +437,11 @@ template void basic_fixed_buffer::grow(std::size_t); template void internal::arg_map::init(const format_args &args); -template int internal::char_traits::format_float( +template FMT_API int internal::char_traits::format_float( char *buffer, std::size_t size, const char *format, unsigned width, int precision, double value); -template int internal::char_traits::format_float( +template FMT_API int internal::char_traits::format_float( char *buffer, std::size_t size, const char *format, unsigned width, int precision, long double value); @@ -453,11 +453,11 @@ template void basic_fixed_buffer::grow(std::size_t); template void internal::arg_map::init(const wformat_args &args); -template int internal::char_traits::format_float( +template FMT_API int internal::char_traits::format_float( wchar_t *buffer, std::size_t size, const wchar_t *format, unsigned width, int precision, double value); -template int internal::char_traits::format_float( +template FMT_API int internal::char_traits::format_float( wchar_t *buffer, std::size_t size, const wchar_t *format, unsigned width, int precision, long double value); diff --git a/include/fmt/format.h b/include/fmt/format.h index fcd72a44..28bf0177 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -282,7 +282,7 @@ class format_error : public std::runtime_error { explicit format_error(const std::string &message) : std::runtime_error(message) {} - ~format_error() throw(); + FMT_API ~format_error() throw(); }; namespace internal { @@ -2095,7 +2095,7 @@ class arg_formatter: public internal::arg_formatter_base { */ class system_error : public std::runtime_error { private: - void init(int err_code, string_view format_str, format_args args); + FMT_API void init(int err_code, string_view format_str, format_args args); protected: int error_code_; @@ -2127,7 +2127,7 @@ class system_error : public std::runtime_error { init(error_code, message, make_args(args...)); } - ~system_error() FMT_DTOR_NOEXCEPT; + FMT_API ~system_error() FMT_DTOR_NOEXCEPT; int error_code() const { return error_code_; } }; diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index b24d026d..9f868b32 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -29,7 +29,7 @@ class FormatBuf : public std::basic_streambuf { this->setp(start_, start_ + buffer_.capacity()); } - int_type overflow(int_type ch = traits_type::eof()) { + int_type overflow(int_type ch = traits_type::eof()) FMT_OVERRIDE { if (!traits_type::eq_int_type(ch, traits_type::eof())) { size_t buf_size = size(); buffer_.resize(buf_size);