From 4883150196f90a36052ee9ebc0fd16e8a1c2f09b Mon Sep 17 00:00:00 2001 From: randomdan Date: Sun, 3 Mar 2013 16:35:20 +0000 Subject: Minor fixes to work with GCC 4.7 --- project2/cgi/cgiStagePresent.cpp | 2 +- project2/common/fileStrmVarWriter.cpp | 2 +- project2/common/options.h | 3 +++ project2/common/scriptLoader.cpp | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/project2/cgi/cgiStagePresent.cpp b/project2/cgi/cgiStagePresent.cpp index c66f409..90299fe 100644 --- a/project2/cgi/cgiStagePresent.cpp +++ b/project2/cgi/cgiStagePresent.cpp @@ -11,7 +11,7 @@ CgiApplicationEngine::PresentStage::PresentStage(ScriptReaderPtr s) : CommonObjects(s->root()), CheckHost(s->root()), ViewHost(s->root()), - presenter([root,this] { + presenter([this] { auto p = PresenterLoader::getFor(this->env()->defaultPresenter)->create(root, Default); auto xp = dynamic_cast(p); auto cp = dynamic_cast(p); diff --git a/project2/common/fileStrmVarWriter.cpp b/project2/common/fileStrmVarWriter.cpp index 47d03e8..caaf908 100644 --- a/project2/common/fileStrmVarWriter.cpp +++ b/project2/common/fileStrmVarWriter.cpp @@ -26,7 +26,7 @@ void FileStreamVariableWriter::operator()(const Boolean & i) const { fprintf(out, i.value ? "true" : "false"); } void FileStreamVariableWriter::operator()(const int64_t & i) const { - fprintf(out, "%"PRId64, i); + fprintf(out, "%" PRId64, i); } void FileStreamVariableWriter::operator()(const double & i) const { fprintf(out, "%g", i); diff --git a/project2/common/options.h b/project2/common/options.h index d4cd891..62a38fb 100644 --- a/project2/common/options.h +++ b/project2/common/options.h @@ -8,6 +8,8 @@ #include #include +#if !__GNUC_PREREQ(4,7) +// If gcc_version >= 4.0 namespace std { // // Should be part of the standard headers, but seems to be missing @@ -28,6 +30,7 @@ namespace std { struct is_assignable : public integral_constant::value> { }; } +#endif class Options { public: diff --git a/project2/common/scriptLoader.cpp b/project2/common/scriptLoader.cpp index 7f02f9b..bd6495b 100644 --- a/project2/common/scriptLoader.cpp +++ b/project2/common/scriptLoader.cpp @@ -133,7 +133,7 @@ LoaderBase::collectAll(const CommonObjects * co, bool childrenOnly, ScriptNodePt throw std::logic_error("Cannot set CommonObjects in subloader"); } Targets::iterator i; - ScopeObject clr(NULL, NULL, [&loadedObjects] { loadedObjects.clear(); }); + ScopeObject clr(NULL, NULL, [] { loadedObjects.clear(); }); while ((i = targets.begin()) != targets.end()) { collectAll(i->first, childrenOnly, i->second); targets.erase(i); -- cgit v1.2.3