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> template<typename TKey, typename TValue>
struct range_mutable_iterator<shared_ptr<icinga::ObjectMap<TKey, 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> template<typename TKey, typename TValue>
struct range_const_iterator<shared_ptr<icinga::ObjectMap<TKey, 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); FD_ZERO(&readfds);
int fd; int fd;
BOOST_FOREACH(tie(fd, tuples::ignore), tasks); BOOST_FOREACH(tie(fd, tuples::ignore), tasks) {
if (fd > nfds) if (fd > nfds)
nfds = fd; nfds = fd;

View File

@ -69,7 +69,7 @@ set<string> Host::GetParents(void) const
if (GetProperty("dependencies", &dependencies)) { if (GetProperty("dependencies", &dependencies)) {
dependencies = Service::ResolveDependencies(*this, dependencies); dependencies = Service::ResolveDependencies(*this, dependencies);
string dependency; Variant dependency;
BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
Service service = Service::GetByName(dependency); Service service = Service::GetByName(dependency);
@ -99,7 +99,7 @@ bool Host::IsReachable(void) const
if (GetProperty("dependencies", &dependencies)) { if (GetProperty("dependencies", &dependencies)) {
dependencies = Service::ResolveDependencies(*this, dependencies); dependencies = Service::ResolveDependencies(*this, dependencies);
string dependency; Variant dependency;
BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
Service service = Service::GetByName(dependency); Service service = Service::GetByName(dependency);
@ -119,7 +119,7 @@ bool Host::IsUp(void) const
if (GetProperty("hostchecks", &hostchecks)) { if (GetProperty("hostchecks", &hostchecks)) {
hostchecks = Service::ResolveDependencies(*this, hostchecks); hostchecks = Service::ResolveDependencies(*this, hostchecks);
string hostcheck; Variant hostcheck;
BOOST_FOREACH(tie(tuples::ignore, hostcheck), hostchecks) { BOOST_FOREACH(tie(tuples::ignore, hostcheck), hostchecks) {
Service service = Service::GetByName(hostcheck); Service service = Service::GetByName(hostcheck);

View File

@ -117,7 +117,7 @@ void Service::GetDependenciesRecursive(const Dictionary::Ptr& result) const {
if (!dependencies) if (!dependencies)
return; return;
string dependency; Variant dependency;
BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
if (result->Contains(dependency)) if (result->Contains(dependency))
continue; continue;
@ -148,7 +148,7 @@ bool Service::IsReachable(void) const
Dictionary::Ptr dependencies = boost::make_shared<Dictionary>(); Dictionary::Ptr dependencies = boost::make_shared<Dictionary>();
GetDependenciesRecursive(dependencies); GetDependenciesRecursive(dependencies);
string dependency; Variant dependency;
BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
Service service = Service::GetByName(dependency); Service service = Service::GetByName(dependency);
@ -379,7 +379,7 @@ bool Service::IsAllowedChecker(const string& checker) const
if (!checkers) if (!checkers)
return true; return true;
string pattern; Variant pattern;
BOOST_FOREACH(tie(tuples::ignore, pattern), checkers) { BOOST_FOREACH(tie(tuples::ignore, pattern), checkers) {
if (Utility::Match(pattern, checker)) if (Utility::Match(pattern, checker))
return true; return true;
@ -395,14 +395,14 @@ Dictionary::Ptr Service::ResolveDependencies(Host host, const Dictionary::Ptr& d
Dictionary::Ptr result = boost::make_shared<Dictionary>(); Dictionary::Ptr result = boost::make_shared<Dictionary>();
string dependency; Variant dependency;
BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) { BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
string name; string name;
if (services && services->Contains(dependency)) if (services && services->Contains(dependency))
name = host.GetName() + "-" + dependency; name = host.GetName() + "-" + static_cast<string>(dependency);
else else
name = dependency; name = static_cast<string>(dependency);
result->Set(name, name); result->Set(name, name);
} }

View File

@ -241,7 +241,7 @@ void CompatComponent::StatusTimerHandler(void)
dict = host.GetGroups(); dict = host.GetGroups();
if (dict) { if (dict) {
string hostgroup; Variant hostgroup;
BOOST_FOREACH(tie(tuples::ignore, hostgroup), dict) { BOOST_FOREACH(tie(tuples::ignore, hostgroup), dict) {
hostgroups[hostgroup].push_back(host.GetName()); hostgroups[hostgroup].push_back(host.GetName());
} }
@ -286,7 +286,7 @@ void CompatComponent::StatusTimerHandler(void)
dict = service.GetGroups(); dict = service.GetGroups();
if (dict) { if (dict) {
string servicegroup; Variant servicegroup;
BOOST_FOREACH(tie(tuples::ignore, servicegroup), dict) { BOOST_FOREACH(tie(tuples::ignore, servicegroup), dict) {
servicegroups[servicegroup].push_back(service); servicegroups[servicegroup].push_back(service);
} }

View File

@ -333,7 +333,7 @@ bool DiscoveryComponent::HasMessagePermission(const Dictionary::Ptr& roles, cons
if (!role->GetProperty(messageType, &permissions)) if (!role->GetProperty(messageType, &permissions))
continue; continue;
string permission; Variant permission;
BOOST_FOREACH(tie(tuples::ignore, permission), permissions) { BOOST_FOREACH(tie(tuples::ignore, permission), permissions) {
if (Utility::Match(permission, message)) if (Utility::Match(permission, message))
return true; return true;
@ -378,7 +378,7 @@ void DiscoveryComponent::ProcessDiscoveryMessage(const string& identity, const D
Dictionary::Ptr publications; Dictionary::Ptr publications;
if (message.GetPublications(&publications)) { if (message.GetPublications(&publications)) {
string publication; Variant publication;
BOOST_FOREACH(tie(tuples::ignore, publication), publications) { BOOST_FOREACH(tie(tuples::ignore, publication), publications) {
if (trusted || HasMessagePermission(roles, "publications", publication)) { if (trusted || HasMessagePermission(roles, "publications", publication)) {
info->Publications.insert(publication); info->Publications.insert(publication);
@ -390,7 +390,7 @@ void DiscoveryComponent::ProcessDiscoveryMessage(const string& identity, const D
Dictionary::Ptr subscriptions; Dictionary::Ptr subscriptions;
if (message.GetSubscriptions(&subscriptions)) { if (message.GetSubscriptions(&subscriptions)) {
string subscription; Variant subscription;
BOOST_FOREACH(tie(tuples::ignore, subscription), subscriptions) { BOOST_FOREACH(tie(tuples::ignore, subscription), subscriptions) {
if (trusted || HasMessagePermission(roles, "subscriptions", subscription)) { if (trusted || HasMessagePermission(roles, "subscriptions", subscription)) {
info->Subscriptions.insert(subscription); info->Subscriptions.insert(subscription);