Build fixes for *NIX.

This commit is contained in:
Gunnar Beutner 2012-07-17 00:01:23 +02:00
parent e2bf3bd56b
commit bc1ded140f
6 changed files with 19 additions and 17 deletions

View File

@ -138,13 +138,15 @@ namespace boost
template<typename TKey, typename TValue>
struct range_mutable_iterator<shared_ptr<icinga::ObjectMap<TKey, TValue> > >
{
typedef typename shared_ptr<icinga::ObjectMap<TKey, TValue> >::Iterator type;
typedef shared_ptr<icinga::ObjectMap<TKey, TValue> > objtype;
typedef typename objtype::Iterator type;
};
template<typename TKey, typename TValue>
struct range_const_iterator<shared_ptr<icinga::ObjectMap<TKey, TValue> > >
{
typedef typename shared_ptr<icinga::ObjectMap<TKey, TValue> > type;
typedef shared_ptr<icinga::ObjectMap<TKey, TValue> > objtype;
typedef typename objtype::Iterator type;
};
}

View File

@ -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;

View File

@ -69,7 +69,7 @@ set<string> 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);

View File

@ -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<Dictionary>();
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<Dictionary>();
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<string>(dependency);
else
name = dependency;
name = static_cast<string>(dependency);
result->Set(name, name);
}

View File

@ -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);
}

View File

@ -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);