From: Gunnar Beutner Date: Mon, 16 Jul 2012 22:01:23 +0000 (+0200) Subject: Build fixes for *NIX. X-Git-Tag: v0.0.1~217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc1ded140f477869b0251a422930286c5c1ad697;p=icinga2 Build fixes for *NIX. --- diff --git a/base/objectmap.h b/base/objectmap.h index b275fc2ce..ec7b9cfdf 100644 --- a/base/objectmap.h +++ b/base/objectmap.h @@ -138,13 +138,15 @@ namespace boost template struct range_mutable_iterator > > { - typedef typename shared_ptr >::Iterator type; + typedef shared_ptr > objtype; + typedef typename objtype::Iterator type; }; template struct range_const_iterator > > { - typedef typename shared_ptr > type; + typedef shared_ptr > objtype; + typedef typename objtype::Iterator type; }; } diff --git a/base/process.cpp b/base/process.cpp index 4b24e3881..38990a89f 100644 --- a/base/process.cpp +++ b/base/process.cpp @@ -67,7 +67,7 @@ void Process::WorkerThreadProc(void) FD_ZERO(&readfds); int fd; - BOOST_FOREACH(tie(fd, tuples::ignore), tasks); + BOOST_FOREACH(tie(fd, tuples::ignore), tasks) { if (fd > nfds) nfds = fd; diff --git a/cib/host.cpp b/cib/host.cpp index 9b697c082..90cfdcb39 100644 --- a/cib/host.cpp +++ b/cib/host.cpp @@ -69,7 +69,7 @@ set Host::GetParents(void) const if (GetProperty("dependencies", &dependencies)) { dependencies = Service::ResolveDependencies(*this, dependencies); - string dependency; + Variant dependency; BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { Service service = Service::GetByName(dependency); @@ -99,7 +99,7 @@ bool Host::IsReachable(void) const if (GetProperty("dependencies", &dependencies)) { dependencies = Service::ResolveDependencies(*this, dependencies); - string dependency; + Variant dependency; BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { Service service = Service::GetByName(dependency); @@ -119,7 +119,7 @@ bool Host::IsUp(void) const if (GetProperty("hostchecks", &hostchecks)) { hostchecks = Service::ResolveDependencies(*this, hostchecks); - string hostcheck; + Variant hostcheck; BOOST_FOREACH(tie(tuples::ignore, hostcheck), hostchecks) { Service service = Service::GetByName(hostcheck); diff --git a/cib/service.cpp b/cib/service.cpp index 33773203e..6e1ec9bd6 100644 --- a/cib/service.cpp +++ b/cib/service.cpp @@ -117,7 +117,7 @@ void Service::GetDependenciesRecursive(const Dictionary::Ptr& result) const { if (!dependencies) return; - string dependency; + Variant dependency; BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { if (result->Contains(dependency)) continue; @@ -148,7 +148,7 @@ bool Service::IsReachable(void) const Dictionary::Ptr dependencies = boost::make_shared(); GetDependenciesRecursive(dependencies); - string dependency; + Variant dependency; BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { Service service = Service::GetByName(dependency); @@ -379,7 +379,7 @@ bool Service::IsAllowedChecker(const string& checker) const if (!checkers) return true; - string pattern; + Variant pattern; BOOST_FOREACH(tie(tuples::ignore, pattern), checkers) { if (Utility::Match(pattern, checker)) return true; @@ -395,14 +395,14 @@ Dictionary::Ptr Service::ResolveDependencies(Host host, const Dictionary::Ptr& d Dictionary::Ptr result = boost::make_shared(); - string dependency; + Variant dependency; BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { string name; if (services && services->Contains(dependency)) - name = host.GetName() + "-" + dependency; + name = host.GetName() + "-" + static_cast(dependency); else - name = dependency; + name = static_cast(dependency); result->Set(name, name); } diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp index 0d759368f..8e7403205 100644 --- a/components/compat/compatcomponent.cpp +++ b/components/compat/compatcomponent.cpp @@ -241,7 +241,7 @@ void CompatComponent::StatusTimerHandler(void) dict = host.GetGroups(); if (dict) { - string hostgroup; + Variant hostgroup; BOOST_FOREACH(tie(tuples::ignore, hostgroup), dict) { hostgroups[hostgroup].push_back(host.GetName()); } @@ -286,7 +286,7 @@ void CompatComponent::StatusTimerHandler(void) dict = service.GetGroups(); if (dict) { - string servicegroup; + Variant servicegroup; BOOST_FOREACH(tie(tuples::ignore, servicegroup), dict) { servicegroups[servicegroup].push_back(service); } diff --git a/components/discovery/discoverycomponent.cpp b/components/discovery/discoverycomponent.cpp index 29811a2ae..3e2adc0f3 100644 --- a/components/discovery/discoverycomponent.cpp +++ b/components/discovery/discoverycomponent.cpp @@ -333,7 +333,7 @@ bool DiscoveryComponent::HasMessagePermission(const Dictionary::Ptr& roles, cons if (!role->GetProperty(messageType, &permissions)) continue; - string permission; + Variant permission; BOOST_FOREACH(tie(tuples::ignore, permission), permissions) { if (Utility::Match(permission, message)) return true; @@ -378,7 +378,7 @@ void DiscoveryComponent::ProcessDiscoveryMessage(const string& identity, const D Dictionary::Ptr publications; if (message.GetPublications(&publications)) { - string publication; + Variant publication; BOOST_FOREACH(tie(tuples::ignore, publication), publications) { if (trusted || HasMessagePermission(roles, "publications", publication)) { info->Publications.insert(publication); @@ -390,7 +390,7 @@ void DiscoveryComponent::ProcessDiscoveryMessage(const string& identity, const D Dictionary::Ptr subscriptions; if (message.GetSubscriptions(&subscriptions)) { - string subscription; + Variant subscription; BOOST_FOREACH(tie(tuples::ignore, subscription), subscriptions) { if (trusted || HasMessagePermission(roles, "subscriptions", subscription)) { info->Subscriptions.insert(subscription);