From aaa0fc396b718a034fb1174e1c1920bbd7877c1f Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 22 Jan 2017 12:16:16 -0800 Subject: [PATCH] Improve compatibility with old compilers and fix test --- fmt/format.h | 6 ++++-- test/util-test.cc | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fmt/format.h b/fmt/format.h index 13be77c3..2a411d94 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -1655,14 +1655,16 @@ class format_spec { T value() const { return value_; } }; +// template +// using fill_spec = format_spec; template class fill_spec : public format_spec { public: explicit fill_spec(Char value) : format_spec(value) {} }; -using width_spec = format_spec; -using type_spec = format_spec; +typedef format_spec width_spec; +typedef format_spec type_spec; class fill_spec_factory { public: diff --git a/test/util-test.cc b/test/util-test.cc index a02bef69..88bad995 100644 --- a/test/util-test.cc +++ b/test/util-test.cc @@ -781,7 +781,7 @@ TEST(UtilTest, WindowsError) { TEST(UtilTest, ReportWindowsError) { fmt::MemoryWriter out; fmt::internal::format_windows_error(out, ERROR_FILE_EXISTS, "test error"); - out << '\n'; + out.write('\n'); EXPECT_WRITE(stderr, fmt::report_windows_error(ERROR_FILE_EXISTS, "test error"), out.str()); }