Change some 'for (const auto& t: type)' usage to the older but equivalent 'for (auto t = type.begin(); ...)'. This patch allows dyninst 9.3.2 to build with gcc 4.4 which doesn't support the newer syntax. diff --git a/dyninstAPI/src/BPatch.C b/dyninstAPI/src/BPatch.C index ebf7db0c4..49fe69f9a 100644 --- a/dyninstAPI/src/BPatch.C +++ b/dyninstAPI/src/BPatch.C @@ -166,16 +166,16 @@ BPatch::BPatch() stdTypes = BPatch_typeCollection::getGlobalTypeCollection(); vector *sTypes = Symtab::getAllstdTypes(); BPatch_type* type = NULL; - for(const auto& t: *sTypes) { - stdTypes->addType(type = new BPatch_type(t)); + for(auto t = sTypes->begin(); t != sTypes->end(); ++t) { + stdTypes->addType(type = new BPatch_type(*t)); type->decrRefCount(); } delete sTypes; builtInTypes = new BPatch_builtInTypeCollection; sTypes = Symtab::getAllbuiltInTypes(); - for(const auto& t: *sTypes) { - builtInTypes->addBuiltInType(type = new BPatch_type(t)); + for(auto t = sTypes->begin(); t != sTypes->end(); ++t) { + builtInTypes->addBuiltInType(type = new BPatch_type(*t)); type->decrRefCount(); } delete sTypes; diff --git a/dyninstAPI/src/BPatch_collections.C b/dyninstAPI/src/BPatch_collections.C index f4e2986a3..129f8b74a 100644 --- a/dyninstAPI/src/BPatch_collections.C +++ b/dyninstAPI/src/BPatch_collections.C @@ -172,12 +172,12 @@ BPatch_typeCollection::~BPatch_typeCollection() assert(refcount == 0 || refcount == 1); - for(const auto& t: typesByName) { - t.second->decrRefCount(); + for(auto t = typesByName.begin(); t != typesByName.end(); ++t) { + t->second->decrRefCount(); } - for(const auto& t: typesByID) { - t.second->decrRefCount(); + for(auto t = typesByID.begin(); t != typesByID.end(); ++t) { + t->second->decrRefCount(); } } diff --git a/symtabAPI/src/Collections.C b/symtabAPI/src/Collections.C index 7431dd6bf..43c339f45 100644 --- a/symtabAPI/src/Collections.C +++ b/symtabAPI/src/Collections.C @@ -318,12 +318,12 @@ typeCollection::typeCollection() : typeCollection::~typeCollection() { // delete all of the types - for(const auto& t: typesByName) { - t.second->decrRefCount(); + for(auto t = typesByName.begin(); t != typesByName.end(); ++t) { + t->second->decrRefCount(); } - for(const auto& t: typesByID) { - t.second->decrRefCount(); + for(auto t = typesByID.begin(); t != typesByID.end(); ++t) { + t->second->decrRefCount(); } }