sword: fix build with gcc47 via a patch from Gentoo
This commit is contained in:
parent
c3cefc669c
commit
3c472d53aa
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
|
|||||||
buildInputs = [ pkgconfig icu cluceneCore curl ];
|
buildInputs = [ pkgconfig icu cluceneCore curl ];
|
||||||
|
|
||||||
# because curl/types.h disappeared since at least curl 7.21.7
|
# 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 = ''
|
prePatch = ''
|
||||||
patchShebangs .;
|
patchShebangs .;
|
||||||
|
35
pkgs/development/libraries/sword/gcc47.patch
Normal file
35
pkgs/development/libraries/sword/gcc47.patch
Normal 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;
|
Loading…
x
Reference in New Issue
Block a user