aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2019-12-05 18:51:48 -0800
committerHaibo Huang <hhb@google.com>2019-12-05 18:51:48 -0800
commit289bd9700073441c2086388c1dc85aa3daea4e08 (patch)
tree44ba216844db84101d41a89caf81cbf61f5f0dbe
parent71aa0b1047729072861452eda91eaa957d95c9ce (diff)
parent071794ec654a7c503b6214de4032c8ec8a07440b (diff)
downloadfmtlib-289bd9700073441c2086388c1dc85aa3daea4e08.tar.gz
Upgrade fmtlib to 6.1.1
Test: None Change-Id: I9c63d6e62c440cffb6914d9edd77bd7632ec1ca2
-rw-r--r--ChangeLog.rst17
-rw-r--r--METADATA4
-rwxr-xr-xdoc/build.py2
-rw-r--r--include/fmt/core.h9
-rw-r--r--include/fmt/format.h7
-rw-r--r--test/format-test.cc1
6 files changed, 28 insertions, 12 deletions
diff --git a/ChangeLog.rst b/ChangeLog.rst
index 25d1b200..dd712418 100644
--- a/ChangeLog.rst
+++ b/ChangeLog.rst
@@ -1,3 +1,18 @@
+6.1.1 - 2019-12-04
+------------------
+
+* Fixed shared library build on Windows
+ (`#1443 <https://github.com/fmtlib/fmt/pull/1443>`_,
+ `#1445 <https://github.com/fmtlib/fmt/issues/1445>`_,
+ `#1446 <https://github.com/fmtlib/fmt/pull/1446>`_,
+ `#1450 <https://github.com/fmtlib/fmt/issues/1450>`_).
+ Thanks `@egorpugin (Egor Pugin) <https://github.com/egorpugin>`_,
+ `@bbolli (Beat Bolli) <https://github.com/bbolli>`_.
+
+* Added a missing decimal point in exponent notation with trailing zeros.
+
+* Removed deprecated ``format_arg_store::TYPES``.
+
6.1.0 - 2019-12-01
------------------
@@ -92,7 +107,7 @@
Thanks `@jeremyong (Jeremy Ong) <https://github.com/jeremyong>`_.
-* Changed formatting of octal zero with prefix from "0o0" to "0":
+* Changed formatting of octal zero with prefix from "00" to "0":
.. code:: c++
diff --git a/METADATA b/METADATA
index 022e25b3..6ccb5573 100644
--- a/METADATA
+++ b/METADATA
@@ -9,10 +9,10 @@ third_party {
type: GIT
value: "https://github.com/fmtlib/fmt.git"
}
- version: "6.1.0"
+ version: "6.1.1"
last_upgrade_date {
year: 2019
month: 12
- day: 3
+ day: 5
}
}
diff --git a/doc/build.py b/doc/build.py
index e8f5f396..2f0c8b80 100755
--- a/doc/build.py
+++ b/doc/build.py
@@ -6,7 +6,7 @@ import errno, os, shutil, sys, tempfile
from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE
from distutils.version import LooseVersion
-versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0']
+versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1']
def pip_install(package, commit=None, **kwargs):
"Install package using pip."
diff --git a/include/fmt/core.h b/include/fmt/core.h
index 6a0846fc..13d74ba8 100644
--- a/include/fmt/core.h
+++ b/include/fmt/core.h
@@ -15,7 +15,7 @@
#include <type_traits>
// The fmt library version in the form major * 10000 + minor * 100 + patch.
-#define FMT_VERSION 60100
+#define FMT_VERSION 60101
#ifdef __has_feature
# define FMT_HAS_FEATURE(x) __has_feature(x)
@@ -167,9 +167,9 @@
#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
# ifdef FMT_EXPORT
-# define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllexport)
+# define FMT_API __declspec(dllexport)
# elif defined(FMT_SHARED)
-# define FMT_API __pragma(warning(suppress : 4275)) __declspec(dllimport)
+# define FMT_API __declspec(dllimport)
# define FMT_EXTERN_TEMPLATE_API FMT_API
# endif
#endif
@@ -224,7 +224,7 @@ namespace internal {
// A workaround for gcc 4.8 to make void_t work in a SFINAE context.
template <typename... Ts> struct void_t_impl { using type = void; };
-void assert_fail(const char* file, int line, const char* message);
+FMT_API void assert_fail(const char* file, int line, const char* message);
#ifndef FMT_ASSERT
# ifdef NDEBUG
@@ -1206,7 +1206,6 @@ template <typename Context, typename... Args> class format_arg_store {
static constexpr unsigned long long types =
is_packed ? internal::encode_types<Context, Args...>()
: internal::is_unpacked_bit | num_args;
- FMT_DEPRECATED static constexpr unsigned long long TYPES = types;
format_arg_store(const Args&... args)
: data_{internal::make_arg<is_packed, Context>(args)...} {}
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 398c2a77..600b0eba 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1145,10 +1145,11 @@ template <typename Char> class float_writer {
if (specs_.format == float_format::exp) {
// Insert a decimal point after the first digit and add an exponent.
*it++ = static_cast<Char>(*digits_);
- if (num_digits_ > 1) *it++ = decimal_point_;
- it = copy_str<Char>(digits_ + 1, digits_ + num_digits_, it);
int num_zeros = specs_.precision - num_digits_;
- if (num_zeros > 0 && specs_.trailing_zeros)
+ bool trailing_zeros = num_zeros > 0 && specs_.trailing_zeros;
+ if (num_digits_ > 1 || trailing_zeros) *it++ = decimal_point_;
+ it = copy_str<Char>(digits_ + 1, digits_ + num_digits_, it);
+ if (trailing_zeros)
it = std::fill_n(it, num_zeros, static_cast<Char>('0'));
*it++ = static_cast<Char>(specs_.upper ? 'E' : 'e');
return write_exponent<Char>(full_exp - 1, it);
diff --git a/test/format-test.cc b/test/format-test.cc
index 84c9d8a0..f52e1275 100644
--- a/test/format-test.cc
+++ b/test/format-test.cc
@@ -1204,6 +1204,7 @@ TEST(FormatterTest, Precision) {
EXPECT_EQ("1.2", format("{0:.2}", 1.2345l));
EXPECT_EQ("1.2e+56", format("{:.2}", 1.234e56));
EXPECT_EQ("1e+00", format("{:.0e}", 1.0L));
+ EXPECT_EQ(" 0.0e+00", format("{:9.1e}", 0.0));
EXPECT_EQ(
"4.9406564584124654417656879286822137236505980261432476442558568250067550"
"727020875186529983636163599237979656469544571773092665671035593979639877"