diff --git a/README b/README index e69de29bb..0f9f6e5b1 100644 --- a/README +++ b/README @@ -0,0 +1,8 @@ +Requirements +------------ + +-C++ compiler that supports C++11 + +or + +-Boost library (components: tr1 smart_ptr bind function make_shared) diff --git a/base/application.cpp b/base/application.cpp index a25279f2d..0e5531c24 100644 --- a/base/application.cpp +++ b/base/application.cpp @@ -228,15 +228,15 @@ Component::Ptr Application::LoadComponent(const string& path, throw ComponentLoadException("Could not load module"); #ifdef _WIN32 - pCreateComponent = reinterpret_cast(GetProcAddress(hModule, - "CreateComponent")); + pCreateComponent = (CreateComponentFunction)GetProcAddress(hModule, + "CreateComponent"); #else /* _WIN32 */ # ifdef __GNUC__ /* suppress compiler warning for void * cast */ __extension__ # endif - pCreateComponent = reinterpret_cast(lt_dlsym(hModule, - "CreateComponent")); + pCreateComponent = (CreateComponentFunction)lt_dlsym(hModule, + "CreateComponent"); #endif /* _WIN32 */ if (pCreateComponent == NULL) @@ -484,7 +484,7 @@ int Application::Run(int argc, char **argv) } else { try { result = Main(m_Arguments); - } catch (const exception& ex) { + } catch (const std::exception& ex) { Application::m_Instance.reset(); Application::Log("---"); diff --git a/base/exception.h b/base/exception.h index 19831f331..b47b3bdce 100644 --- a/base/exception.h +++ b/base/exception.h @@ -28,7 +28,7 @@ namespace icinga * * @ingroup base */ -class I2_BASE_API Exception : public virtual exception +class I2_BASE_API Exception : public virtual std::exception { public: Exception(void); diff --git a/base/i2-base.h b/base/i2-base.h index 6dfdc7658..683ce3bda 100644 --- a/base/i2-base.h +++ b/base/i2-base.h @@ -80,6 +80,7 @@ #include #include +#include #include #include #include @@ -90,29 +91,33 @@ #include #include +using namespace std; +using std::exception; + #ifdef HAVE_CXX11 # include # include -using namespace std; using namespace std::placeholders; #else /* HAVE_CXX11 */ # ifdef HAVE_BOOST -# include -# include +# include +# include +# include +# include -using namespace std; +using namespace boost; # else /* HAVE_BOOST */ # include # include # include "cxx11-compat.h" -using namespace std; -using namespace std::placeholders; +using namespace std::tr1; +using namespace std::tr1::placeholders; -# endif /* HAVE_BOOST */ +#endif /* HAVE_BOOST */ #endif /* HAVE_CXX11 */ #if defined(__APPLE__) && defined(__MACH__) diff --git a/mmatch/mmatch.c b/mmatch/mmatch.c index 10b8ce300..d8054b180 100644 --- a/mmatch/mmatch.c +++ b/mmatch/mmatch.c @@ -302,4 +302,5 @@ char *collapse(char *mask) while (*m++); }; return mask; -} \ No newline at end of file +} +