From 7e251643db8ec10d7b2163dac777c2c23f03bd10 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 9 Mar 2015 08:48:08 -0700 Subject: [PATCH 1/3] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 75d38cc0..e3f4450c 100644 --- a/README.rst +++ b/README.rst @@ -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. From a037a829f5bfedf8e9a473a960893a2dfd4452f9 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 9 Mar 2015 09:29:46 -0700 Subject: [PATCH 2/3] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e3f4450c..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++. From 55836caa8d98703ba47b566bf32fa596463b7aa7 Mon Sep 17 00:00:00 2001 From: cstamford Date: Tue, 10 Mar 2015 07:04:31 +0000 Subject: [PATCH 3/3] Added the define FMT_SWPRINTF to allow compilation under TDM-gcc (and possibly other MinGW distributions). --- format.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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