ConfigCompilerContext::GetInstance()->Reset();
if (g_AppParams.count("config") > 0) {
- BOOST_FOREACH(const String& configPath, g_AppParams["config"].as<std::vector<String> >()) {
+ BOOST_FOREACH(const String& configPath, g_AppParams["config"].as<std::vector<std::string> >()) {
ConfigCompiler::CompileFile(configPath);
}
}
desc.add_options()
("help", "show this help message")
("version,V", "show version information")
- ("library,l", po::value<std::vector<String> >(), "load a library")
- ("include,I", po::value<std::vector<String> >(), "add include search directory")
- ("define,D", po::value<std::vector<String> >(), "define a constant")
- ("config,c", po::value<std::vector<String> >(), "parse a configuration file")
+ ("library,l", po::value<std::vector<std::string> >(), "load a library")
+ ("include,I", po::value<std::vector<std::string> >(), "add include search directory")
+ ("define,D", po::value<std::vector<std::string> >(), "define a constant")
+ ("config,c", po::value<std::vector<std::string> >(), "parse a configuration file")
("no-config,z", "start without a configuration file")
("validate,C", "exit after validating the configuration")
("no-validate,Z", "skip validating the configuration")
("debug,x", "enable debugging")
("daemonize,d", "detach from the controlling terminal")
- ("errorlog,e", po::value<String>(), "log fatal errors to the specified log file (only works in combination with --daemonize)")
+ ("errorlog,e", po::value<std::string>(), "log fatal errors to the specified log file (only works in combination with --daemonize)")
#ifndef _WIN32
- ("user,u", po::value<String>(), "user to run Icinga as")
- ("group,g", po::value<String>(), "group to run Icinga as")
+ ("user,u", po::value<std::string>(), "user to run Icinga as")
+ ("group,g", po::value<std::string>(), "group to run Icinga as")
#endif
;
#ifndef _WIN32
if (g_AppParams.count("group")) {
- String group = g_AppParams["group"].as<String>();
+ String group = g_AppParams["group"].as<std::string>();
errno = 0;
struct group *gr = getgrnam(group.CStr());
}
if (g_AppParams.count("user")) {
- String user = g_AppParams["user"].as<String>();
+ String user = g_AppParams["user"].as<std::string>();
errno = 0;
struct passwd *pw = getpwnam(user.CStr());
}
if (g_AppParams.count("define")) {
- BOOST_FOREACH(const String& define, g_AppParams["define"].as<std::vector<String> >()) {
+ BOOST_FOREACH(const String& define, g_AppParams["define"].as<std::vector<std::string> >()) {
String key, value;
size_t pos = define.FindFirstOf('=');
if (pos != String::NPos) {
String appType = LoadAppType(Application::GetApplicationType());
if (g_AppParams.count("library")) {
- BOOST_FOREACH(const String& libraryName, g_AppParams["library"].as<std::vector<String> >()) {
+ BOOST_FOREACH(const String& libraryName, g_AppParams["library"].as<std::vector<std::string> >()) {
(void) Utility::LoadExtensionLibrary(libraryName);
}
}
ConfigCompiler::AddIncludeSearchDir(Application::GetPkgDataDir());
if (g_AppParams.count("include")) {
- BOOST_FOREACH(const String& includePath, g_AppParams["include"].as<std::vector<String> >()) {
+ BOOST_FOREACH(const String& includePath, g_AppParams["include"].as<std::vector<std::string> >()) {
ConfigCompiler::AddIncludeSearchDir(includePath);
}
}
String errorLog;
if (g_AppParams.count("errorlog"))
- errorLog = g_AppParams["errorlog"].as<String>();
+ errorLog = g_AppParams["errorlog"].as<std::string>();
Daemonize(errorLog);
Logger::DisableConsoleLog();
if (real_cxa_throw == 0)
real_cxa_throw = (cxa_throw_fn)dlsym(RTLD_NEXT, "__cxa_throw");
-#ifndef __APPLE__
+#ifdef __GLIBC__
void *thrown_ptr = obj;
const std::type_info *tinfo = static_cast<std::type_info *>(pvtinfo);
const std::type_info *boost_exc = &typeid(boost::exception);
thrown_ptr = *(void **)thrown_ptr;
if (!user_exc->__do_catch(tinfo, &thrown_ptr, 1)) {
-#endif /* __APPLE__ */
+#endif /* __GLIBCXX__ */
StackTrace stack;
SetLastExceptionStack(stack);
ContextTrace context;
SetLastExceptionContext(context);
-#ifndef __APPLE__
+#ifdef __GLIBCXX__
/* Check if thrown_ptr inherits from boost::exception. */
if (boost_exc->__do_catch(tinfo, &thrown_ptr, 1)) {
boost::exception *ex = (boost::exception *)thrown_ptr;
*ex << ContextTraceErrorInfo(context);
}
}
-#endif /* __APPLE__ */
+#endif /* __GLIBCXX__ */
real_cxa_throw(obj, pvtinfo, dest);
}