From 1b0977a512863abb36963297e2559b263a5cb77a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 10 Oct 2013 23:06:28 +0200 Subject: [PATCH] Windows build fix. --- components/cluster/clusterlistener.cpp | 4 ++++ lib/base/base.vcxproj | 4 ++++ lib/base/base.vcxproj.filters | 12 ++++++++++++ lib/base/stdiostream.h | 2 +- lib/base/tlsutility.h | 2 +- lib/base/zlibstream.h | 2 +- lib/db_ido/servicedbobject.cpp | 2 +- lib/icinga/icinga.vcxproj | 2 ++ lib/icinga/icinga.vcxproj.filters | 6 ++++++ 9 files changed, 32 insertions(+), 4 deletions(-) diff --git a/components/cluster/clusterlistener.cpp b/components/cluster/clusterlistener.cpp index ce86fb9b7..1a85d899a 100644 --- a/components/cluster/clusterlistener.cpp +++ b/components/cluster/clusterlistener.cpp @@ -1414,7 +1414,11 @@ void ClusterListener::MessageHandler(const Endpoint::Ptr& sender, const Dictiona Log(LogInformation, "cluster", "Processing config update for identity '" + identity + "'."); String dir = GetClusterDir() + "config/" + SHA256(identity); +#ifndef _WIN32 if (mkdir(dir.CStr(), 0700) < 0 && errno != EEXIST) { +#else /*_ WIN32 */ + if (mkdir(dir.CStr()) < 0 && errno != EEXIST) { +#endif /* _WIN32 */ BOOST_THROW_EXCEPTION(posix_error() << boost::errinfo_api_function("localtime") << boost::errinfo_errno(errno)); diff --git a/lib/base/base.vcxproj b/lib/base/base.vcxproj index f68d71ca7..bb8e0e86a 100644 --- a/lib/base/base.vcxproj +++ b/lib/base/base.vcxproj @@ -62,6 +62,8 @@ + + @@ -112,6 +114,8 @@ + + diff --git a/lib/base/base.vcxproj.filters b/lib/base/base.vcxproj.filters index ac97bf4aa..b7861d761 100644 --- a/lib/base/base.vcxproj.filters +++ b/lib/base/base.vcxproj.filters @@ -127,6 +127,12 @@ Quelldateien + + Quelldateien + + + Quelldateien + @@ -273,6 +279,12 @@ Headerdateien + + Headerdateien + + + Headerdateien + diff --git a/lib/base/stdiostream.h b/lib/base/stdiostream.h index 228d6cfc2..3eb30f151 100644 --- a/lib/base/stdiostream.h +++ b/lib/base/stdiostream.h @@ -26,7 +26,7 @@ namespace icinga { -class StdioStream : public Stream +class I2_BASE_API StdioStream : public Stream { public: DECLARE_PTR_TYPEDEFS(StdioStream); diff --git a/lib/base/tlsutility.h b/lib/base/tlsutility.h index d25d2f849..e0eb4e971 100644 --- a/lib/base/tlsutility.h +++ b/lib/base/tlsutility.h @@ -36,7 +36,7 @@ namespace icinga shared_ptr I2_BASE_API MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey); String I2_BASE_API GetCertificateCN(const shared_ptr& certificate); shared_ptr I2_BASE_API GetX509Certificate(const String& pemfile); -String SHA256(const String& s); +String I2_BASE_API SHA256(const String& s); class I2_BASE_API openssl_error : virtual public std::exception, virtual public boost::exception { }; diff --git a/lib/base/zlibstream.h b/lib/base/zlibstream.h index 0b3d7926a..f08688a9f 100644 --- a/lib/base/zlibstream.h +++ b/lib/base/zlibstream.h @@ -28,7 +28,7 @@ namespace icinga { -class ZlibStream : public Stream +class I2_BASE_API ZlibStream : public Stream { public: DECLARE_PTR_TYPEDEFS(ZlibStream); diff --git a/lib/db_ido/servicedbobject.cpp b/lib/db_ido/servicedbobject.cpp index f98326583..391925c2e 100644 --- a/lib/db_ido/servicedbobject.cpp +++ b/lib/db_ido/servicedbobject.cpp @@ -69,7 +69,7 @@ void ServiceDbObject::StaticInitialize(void) Service::OnEventCommandExecuted.connect(bind(&ServiceDbObject::AddEventHandlerHistory, _1)); - ExternalCommandProcessor::OnNewExternalCommand.connect(bind(&ServiceDbObject::AddExternalCommandHistory, _1, _2, _3)); + ExternalCommandProcessor::OnNewExternalCommand.connect(boost::bind(&ServiceDbObject::AddExternalCommandHistory, _1, _2, _3)); } ServiceDbObject::ServiceDbObject(const DbType::Ptr& type, const String& name1, const String& name2) diff --git a/lib/icinga/icinga.vcxproj b/lib/icinga/icinga.vcxproj index 997a97d1f..67f047409 100644 --- a/lib/icinga/icinga.vcxproj +++ b/lib/icinga/icinga.vcxproj @@ -25,6 +25,7 @@ + @@ -65,6 +66,7 @@ + diff --git a/lib/icinga/icinga.vcxproj.filters b/lib/icinga/icinga.vcxproj.filters index be841daac..dbba51c21 100644 --- a/lib/icinga/icinga.vcxproj.filters +++ b/lib/icinga/icinga.vcxproj.filters @@ -100,6 +100,9 @@ Quelldateien + + Quelldateien + @@ -183,6 +186,9 @@ Headerdateien + + Headerdateien + -- 2.40.0