Compilation fixes for *NIX.

This commit is contained in:
Gunnar Beutner 2012-06-15 19:52:39 +02:00
parent 0bd5323629
commit 9ab3f6aaba
3 changed files with 3 additions and 3 deletions

View File

@ -353,6 +353,7 @@ string Application::GetExeDirectory(void) const
if (getcwd(Cwd, sizeof(Cwd)) == NULL)
throw PosixException("getcwd failed", errno);
// TODO:: C++ify this.
if (argv0[0] != '/')
snprintf(FullExePath, sizeof(FullExePath), "%s/%s", Cwd, argv0);
else
@ -365,7 +366,7 @@ string Application::GetExeDirectory(void) const
PathEnv = strdup(PathEnv);
if (PathEnv == NULL)
throw bad_alloc();
throw runtime_error("strdup failed");
FoundPath = false;

View File

@ -120,7 +120,6 @@ using boost::enable_shared_from_this;
using boost::dynamic_pointer_cast;
using boost::static_pointer_cast;
using boost::function;
using boost::signal;
#if defined(__APPLE__) && defined(__MACH__)
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"

View File

@ -66,7 +66,7 @@ vector<ConfigItem::Ptr> ConfigCompiler::CompileFile(const string& filename)
{
ifstream stream;
stream.exceptions(ifstream::badbit);
stream.open(filename, ifstream::in);
stream.open(filename.c_str(), ifstream::in);
return CompileStream(&stream);
}