[gource] Fix build failure with gcc-4.7
Siddhesh Poyarekar
siddhesh at fedoraproject.org
Tue Jan 17 10:41:02 UTC 2012
commit 37d868ea2f1a0884565082ee7f63ab465dee23de
Author: Siddhesh Poyarekar <siddhesh.poyarekar at gmail.com>
Date: Tue Jan 17 16:12:18 2012 +0530
Fix build failure with gcc-4.7
gource-build-fix.patch | 76 ++++++++++++++++++++++++++++++++++++++++++++++++
gource.spec | 8 ++++-
2 files changed, 83 insertions(+), 1 deletions(-)
---
diff --git a/gource-build-fix.patch b/gource-build-fix.patch
new file mode 100644
index 0000000..c4f9726
--- /dev/null
+++ b/gource-build-fix.patch
@@ -0,0 +1,76 @@
+diff --git a/home/siddhesh/src/fedora/gource/gource-0.37/src/core/utf8/checked.h b/src/core/utf8/checked.h
+index 16bab4d..ce50c4f 100644
+--- a/home/siddhesh/src/fedora/gource/gource-0.37/src/core/utf8/checked.h
++++ b/src/core/utf8/checked.h
+@@ -65,6 +65,35 @@ namespace utf8
+
+ /// The library API - functions intended to be called by the users
+
++ template <typename octet_iterator>
++ octet_iterator append(uint32_t cp, octet_iterator result)
++ {
++ if (!internal::is_code_point_valid(cp))
++ throw invalid_code_point(cp);
++
++ if (cp < 0x80) // one octet
++ *(result++) = static_cast<uint8_t>(cp);
++ else if (cp < 0x800) { // two octets
++ *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
++ }
++ else if (cp < 0x10000) { // three octets
++ *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0);
++ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
++ }
++ else if (cp <= internal::CODE_POINT_MAX) { // four octets
++ *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
++ *(result++) = static_cast<uint8_t>(((cp >> 12) & 0x3f) | 0x80);
++ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
++ }
++ else
++ throw invalid_code_point(cp);
++
++ return result;
++ }
++
+ template <typename octet_iterator, typename output_iterator>
+ output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement)
+ {
+@@ -104,35 +133,6 @@ namespace utf8
+ }
+
+ template <typename octet_iterator>
+- octet_iterator append(uint32_t cp, octet_iterator result)
+- {
+- if (!internal::is_code_point_valid(cp))
+- throw invalid_code_point(cp);
+-
+- if (cp < 0x80) // one octet
+- *(result++) = static_cast<uint8_t>(cp);
+- else if (cp < 0x800) { // two octets
+- *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
+- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+- }
+- else if (cp < 0x10000) { // three octets
+- *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0);
+- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
+- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+- }
+- else if (cp <= internal::CODE_POINT_MAX) { // four octets
+- *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
+- *(result++) = static_cast<uint8_t>(((cp >> 12) & 0x3f) | 0x80);
+- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
+- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+- }
+- else
+- throw invalid_code_point(cp);
+-
+- return result;
+- }
+-
+- template <typename octet_iterator>
+ uint32_t next(octet_iterator& it, octet_iterator end)
+ {
+ uint32_t cp = 0;
diff --git a/gource.spec b/gource.spec
index c4bc0d7..0f3ee37 100644
--- a/gource.spec
+++ b/gource.spec
@@ -1,10 +1,12 @@
Summary: Software version control visualization
Name: gource
Version: 0.37
-Release: 2%{?dist}
+Release: 3%{?dist}
URL: http://gource.googlecode.com/
Source: https://gource.googlecode.com/files/%{name}-%{version}.tar.gz
+Patch1: gource-build-fix.patch
+
License: GPLv3+
Group: Applications/Productivity
@@ -31,6 +33,7 @@ files and directories.
%prep
%setup -q
+%patch1 -p1
sed -i.cp -e 's|cp |cp -p |' Makefile.in
%build
@@ -51,6 +54,9 @@ rm -rf %{buildroot}/%{_datadir}/%{name}/fonts
%{_datadir}/gource/*
%changelog
+* Tue Jan 17 2012 Siddhesh Poyarekar <siddhesh at redhat.com> - 0.37-3
+- Fix build failure with gcc-4.7
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.37-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list