Fix compile error with gcc-4.7

This commit is contained in:
Deji Akingunola 2012-02-22 22:57:36 -05:00
parent 78984a5692
commit 8da4be434d
2 changed files with 28 additions and 1 deletions

22
sword-gcc47-fix.patch Normal file
View File

@ -0,0 +1,22 @@
--- include/multimapwdef.h 2004-05-04 17:01:39.000000000 -0400
+++ include/multimapwdef.h.new 2012-02-22 22:05:38.034034838 -0500
@@ -19,14 +19,14 @@
}
T& operator[](const Key& k) {
- if (find(k) == this->end()) {
- insert(value_type(k, T()));
+ if (this->find(k) == this->end()) {
+ this->insert(value_type(k, T()));
}
- return (*(find(k))).second;
+ return (*(this->find(k))).second;
}
bool has(const Key& k, const T &val) const {
- typename std::multimap<Key, T, Compare>::const_iterator start = lower_bound(k);
- typename std::multimap<Key, T, Compare>::const_iterator end = upper_bound(k);
+ typename std::multimap<Key, T, Compare>::const_iterator start = this->lower_bound(k);
+ typename std::multimap<Key, T, Compare>::const_iterator end = this->upper_bound(k);
for (; start!=end; start++) {
if (start->second == val)
return true;

View File

@ -1,6 +1,6 @@
Name: sword
Version: 1.6.2
Release: 6%{?dist}
Release: 7%{?dist}
Summary: Free Bible Software Project
Group: System Environment/Libraries
@ -18,6 +18,7 @@ BuildRequires: cppunit-devel
Patch0: sword-no-curl-types.patch
Patch1: sword-1.6.2-clucene2.patch
Patch2: sword-gcc47-fix.patch
%description
The SWORD Project is the CrossWire Bible Society's free Bible software
@ -45,6 +46,7 @@ that uses the sword API, such as Gnomesword or Bibletime.
%setup -q
%patch0 -p1 -b .no-curl-types
%patch1 -p1 -b .clucene2
%patch2 -p0 -b .gcc47
%build
%configure --disable-static --with-icu --with-clucene=%{_prefix}
@ -87,6 +89,9 @@ rm -rf %{buildroot}
%{_libdir}/libsword.so
%changelog
* Wed Feb 22 2012 Deji Akingunola <dakingun@gmail.com> - 1.6.2-7
- Fix compile error with gcc-4.7
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild