sword: fix build with gcc47 via a patch from Gentoo

This commit is contained in:
Vladimír Čunát 2013-03-17 12:37:39 +01:00
parent c3cefc669c
commit 3c472d53aa
2 changed files with 36 additions and 1 deletions

View File

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
buildInputs = [ pkgconfig icu cluceneCore curl ];
# because curl/types.h disappeared since at least curl 7.21.7
patches = [ ./dont_include_curl_types_h.patch ];
patches = [ ./dont_include_curl_types_h.patch ./gcc47.patch ];
prePatch = ''
patchShebangs .;

View File

@ -0,0 +1,35 @@
https://bugs.gentoo.org/419505
--- a/include/multimapwdef.h
+++ b/include/multimapwdef.h
@@ -12,21 +12,21 @@ class multimapwithdefault : public std::multimap<Key, T, Compare> {
public:
typedef std::pair<const Key, T> value_type;
T& getWithDefault(const Key& k, const T& defaultValue) {
- if (find(k) == this->end()) {
- insert(value_type(k, defaultValue));
+ if (this->find(k) == this->end()) {
+ this->insert(value_type(k, defaultValue));
}
- return (*(find(k))).second;
+ return (*(this->find(k))).second;
}
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;