[Scummvm-git-logs] scummvm master -> c19c10d548b2867bc4fd003fb29ac0017b2bd29d
tobiatesan
tobia.tesan at gmail.com
Sat Jun 24 11:05:33 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c19c10d548 CREATE_PROJECT: Add fix for nested ifs
Commit: c19c10d548b2867bc4fd003fb29ac0017b2bd29d
https://github.com/scummvm/scummvm/commit/c19c10d548b2867bc4fd003fb29ac0017b2bd29d
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-06-24T11:05:29+02:00
Commit Message:
CREATE_PROJECT: Add fix for nested ifs
This adds a quick fix so that any if blocks nested inside a if block
with an unmet condition are handled with push(false) even if their
condition is satisfied.
For example, without this modification, upon running create_project.exe
--msvc --disable-cloud --enable-libcurl the block inside
ifdef USE_CLOUD
ifdef USE_LIBCURL
...
endif
endif
in backends/module.mk would get evaluated since it was inside
USE_LIBCURL (=1), leading to unpredictable results.
Changed paths:
devtools/create_project/create_project.cpp
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index d0cc7da..6715191 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -1770,18 +1770,20 @@ void ProjectProvider::createModuleList(const std::string &moduleDir, const Strin
if (std::find(defines.begin(), defines.end(), *i) == defines.end())
shouldInclude.push(false);
else
- shouldInclude.push(true);
+ shouldInclude.push(true && shouldInclude.top());
} else if (*i == "ifndef") {
if (tokens.size() < 2)
error("Malformed ifndef in " + moduleMkFile);
++i;
if (std::find(defines.begin(), defines.end(), *i) == defines.end())
- shouldInclude.push(true);
+ shouldInclude.push(true && shouldInclude.top());
else
shouldInclude.push(false);
} else if (*i == "else") {
- shouldInclude.top() = !shouldInclude.top();
+ bool last = shouldInclude.top();
+ shouldInclude.pop();
+ shouldInclude.push(!last && shouldInclude.top());
} else if (*i == "endif") {
if (shouldInclude.size() <= 1)
error("endif without ifdef found in " + moduleMkFile);
More information about the Scummvm-git-logs
mailing list