Fix expected unqualified-id before numeric constant error

This commit is contained in:
Dave Johansen 2016-11-15 19:52:08 -07:00
parent c34786efe5
commit 204c93a086
2 changed files with 38 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Name: fmt
Version: 3.0.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Small, safe and fast formatting library for C++
License: BSD
@ -10,6 +10,8 @@ Source0: https://github.com/fmtlib/fmt/releases/download/%{version}/%{nam
Patch0: fmt_gmock_crash.patch
# See https://github.com/fmtlib/fmt/issues/329
Patch1: fmt_mock_locale.patch
# See https://github.com/fmtlib/fmt/issues/398
Patch2: fmt_char_width.patch
%if 0%{?rhel}
BuildRequires: cmake3
@ -107,5 +109,8 @@ make -C build test
%postun -p /sbin/ldconfig
%changelog
* Tue Nov 15 2016 Dave Johansen <davejohansen@gmail.com> - 3.0.0-2
- Fix expected unqualified-id before numeric constant error
* Wed Aug 24 2016 Dave Johansen <davejohansen@gmail.com> - 3.0.0-1
- Initial RPM release

32
fmt_char_width.patch Normal file
View File

@ -0,0 +1,32 @@
--- a/fmt/format.h
+++ b/fmt/format.h
@@ -1822,21 +1822,21 @@
typedef typename BasicWriter<Char>::CharPtr CharPtr;
Char fill = internal::CharTraits<Char>::cast(spec_.fill());
CharPtr out = CharPtr();
- const unsigned CHAR_WIDTH = 1;
- if (spec_.width_ > CHAR_WIDTH) {
+ const unsigned CHAR_SIZE = 1;
+ if (spec_.width_ > CHAR_SIZE) {
out = writer_.grow_buffer(spec_.width_);
if (spec_.align_ == ALIGN_RIGHT) {
- std::uninitialized_fill_n(out, spec_.width_ - CHAR_WIDTH, fill);
- out += spec_.width_ - CHAR_WIDTH;
+ std::uninitialized_fill_n(out, spec_.width_ - CHAR_SIZE, fill);
+ out += spec_.width_ - CHAR_SIZE;
} else if (spec_.align_ == ALIGN_CENTER) {
out = writer_.fill_padding(out, spec_.width_,
- internal::check(CHAR_WIDTH), fill);
+ internal::check(CHAR_SIZE), fill);
} else {
- std::uninitialized_fill_n(out + CHAR_WIDTH,
- spec_.width_ - CHAR_WIDTH, fill);
+ std::uninitialized_fill_n(out + CHAR_SIZE,
+ spec_.width_ - CHAR_SIZE, fill);
}
} else {
- out = writer_.grow_buffer(CHAR_WIDTH);
+ out = writer_.grow_buffer(CHAR_SIZE);
}
*out = internal::CharTraits<Char>::cast(value);
}