From: Amos Jeffries Date: Fri, 21 Nov 2014 04:33:21 +0000 (-0800) Subject: Fix build errors on CentOS 7 in rev.13712 X-Git-Tag: merge-candidate-3-v1~478 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c70b36bdf9fd32919a938ded09e3edd0fb9ee129;p=thirdparty%2Fsquid.git Fix build errors on CentOS 7 in rev.13712 It turns out the RHEL and CentOS 7 STL definition does not quite match up to official documentation of what their GCC version supports. In particular the use of const_iterator on std::list containers. Use auto instead of an explicit iterator. Allowing the compiler to select whichever iterator is available and will work. --- diff --git a/src/acl/MethodData.cc b/src/acl/MethodData.cc index 17086a08bc..552315cccb 100644 --- a/src/acl/MethodData.cc +++ b/src/acl/MethodData.cc @@ -29,7 +29,7 @@ ACLMethodData::~ACLMethodData() bool ACLMethodData::match(HttpRequestMethod toFind) { - for (std::list::const_iterator i = values.begin(); i != values.end(); ++i) { + for (auto i = values.begin(); i != values.end(); ++i) { if (*i == toFind) { // tune the list for LRU ordering values.erase(i); diff --git a/src/acl/ProtocolData.cc b/src/acl/ProtocolData.cc index 6f8080e36a..d0d96d362d 100644 --- a/src/acl/ProtocolData.cc +++ b/src/acl/ProtocolData.cc @@ -28,7 +28,7 @@ ACLProtocolData::~ACLProtocolData() bool ACLProtocolData::match(AnyP::ProtocolType toFind) { - for (std::list::const_iterator itr = values.begin(); itr != values.end(); ++itr) { + for (auto itr = values.begin(); itr != values.end(); ++itr) { if (*itr == toFind) { // tune the list for LRU ordering values.erase(itr);