diff --git a/README.rst b/README.rst index 75d38cc0..7ef23422 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,7 @@ C++ Format :target: http://cppformat.readthedocs.org/en/stable/ :alt: Documentation Status -.. image:: https://webapi.biicode.com/v1/badges/vitaut/vitaut/cppformat/master +.. image:: https://webapi.biicode.com/v1/badges/vitaut/vitaut/cppformat/master?dummy :target: https://www.biicode.com/vitaut/cppformat C++ Format is an open-source formatting library for C++. @@ -288,7 +288,7 @@ tinyformat 2.0.1 tfm::printf 2.25 Boost Format 1.54 boost::format 9.94 ================= ============= =========== -As you can see boost::format is much slower than the alternative methods; this +As you can see ``boost::format`` is much slower than the alternative methods; this is confirmed by `other tests `_. Tinyformat is quite good coming close to IOStreams. Unfortunately tinyformat cannot be faster than the IOStreams because it uses them internally. diff --git a/format.cc b/format.cc index 13474980..865b78cf 100644 --- a/format.cc +++ b/format.cc @@ -100,6 +100,12 @@ inline int fmt_snprintf(char *buffer, size_t size, const char *format, ...) { # define FMT_SNPRINTF fmt_snprintf #endif // _MSC_VER +#if defined(_WIN32) && defined(__MINGW32__) && !defined(__NO_ISOCEXT) +# define FMT_SWPRINTF snwprintf +#else +# define FMT_SWPRINTF swprintf +#endif // defined(_WIN32) && defined(__MINGW32__) && !defined(__NO_ISOCEXT) + // Checks if a value fits in int - used to avoid warnings about comparing // signed and unsigned integers. template @@ -388,12 +394,12 @@ int fmt::internal::CharTraits::format_float( unsigned width, int precision, T value) { if (width == 0) { return precision < 0 ? - swprintf(buffer, size, format, value) : - swprintf(buffer, size, format, precision, value); + FMT_SWPRINTF(buffer, size, format, value) : + FMT_SWPRINTF(buffer, size, format, precision, value); } return precision < 0 ? - swprintf(buffer, size, format, width, value) : - swprintf(buffer, size, format, width, precision, value); + FMT_SWPRINTF(buffer, size, format, width, value) : + FMT_SWPRINTF(buffer, size, format, width, precision, value); } template