]> granicus.if.org Git - icinga2/commitdiff
Fixed compilation on Solaris 10.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 25 May 2012 14:56:47 +0000 (16:56 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 25 May 2012 14:56:47 +0000 (16:56 +0200)
README
base/application.cpp
base/exception.h
base/i2-base.h
mmatch/mmatch.c

diff --git a/README b/README
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0f9f6e5b1604f3be89e868a505e640eaf351aeda 100644 (file)
--- 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)
index a25279f2d7e9ab0e6687107da1bc29639af8fb9d..0e5531c2451fe4a486f602cbde56e8cb19bc413f 100644 (file)
@@ -228,15 +228,15 @@ Component::Ptr Application::LoadComponent(const string& path,
                throw ComponentLoadException("Could not load module");
 
 #ifdef _WIN32
-       pCreateComponent = reinterpret_cast<CreateComponentFunction>(GetProcAddress(hModule,
-           "CreateComponent"));
+       pCreateComponent = (CreateComponentFunction)GetProcAddress(hModule,
+           "CreateComponent");
 #else /* _WIN32 */
 #      ifdef __GNUC__
        /* suppress compiler warning for void * cast */
        __extension__
 #      endif
-       pCreateComponent = reinterpret_cast<CreateComponentFunction>(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("---");
index 19831f3317a745508246250cfeec67ed484827bf..b47b3bdce84a9ad5a3766d005dc547ac72d436a4 100644 (file)
@@ -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);
index 6dfdc7658b5d5768eada6ad1e63828657576c695..683ce3bda5c4e00390c7abcf798896739adf1f13 100644 (file)
@@ -80,6 +80,7 @@
 #include <cerrno>
 
 #include <string>
+#include <exception>
 #include <sstream>
 #include <vector>
 #include <set>
 #include <list>
 #include <algorithm>
 
+using namespace std;
+using std::exception;
+
 #ifdef HAVE_CXX11
 #      include <memory>
 #      include <functional>
 
-using namespace std;
 using namespace std::placeholders;
 
 #else /* HAVE_CXX11 */
 #      ifdef HAVE_BOOST
-#              include <boost/tr1/memory.hpp>
-#              include <boost/tr1/functional.hpp>
+#              include <boost/smart_ptr.hpp>
+#              include <boost/make_shared.hpp>
+#              include <boost/bind.hpp>
+#              include <boost/function.hpp>
 
-using namespace std;
+using namespace boost;
 
 #      else /* HAVE_BOOST */
 #              include <tr1/memory>
 #              include <tr1/functional>
 #              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__)
index 10b8ce300a06fef13cf1c60ebf51fdc1ad312984..d8054b180bed8ef3649a92f613689d9dec3a1127 100644 (file)
@@ -302,4 +302,5 @@ char *collapse(char *mask)
     while (*m++);
   };
   return mask;
-}
\ No newline at end of file
+}
+