Fixed compilation on Solaris 10.

This commit is contained in:
Gunnar Beutner 2012-05-25 16:56:47 +02:00
parent 70b2595b26
commit e14bf9faec
5 changed files with 28 additions and 14 deletions

8
README
View File

@ -0,0 +1,8 @@
Requirements
------------
-C++ compiler that supports C++11
or
-Boost library (components: tr1 smart_ptr bind function make_shared)

View 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("---");

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

View File

@ -80,6 +80,7 @@
#include <cerrno>
#include <string>
#include <exception>
#include <sstream>
#include <vector>
#include <set>
@ -90,29 +91,33 @@
#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__)

View File

@ -302,4 +302,5 @@ char *collapse(char *mask)
while (*m++);
};
return mask;
}
}