Publish VCC Plus OSS source distribution for 3.6.2 build 60

This commit is contained in:
Brian Holman committed 2026-11-13 00:14:03 -07:00
commit c652a5276d
1192 files changed
+272368

No files matched your search

+161
View File
@@ -0,0 +1,161 @@
--- a/src/TranslationUnit.cpp
+++ b/src/TranslationUnit.cpp
@@ -2240,6 +2240,41 @@
}
+// VCC Plus, 2026-11-03: dependency paths are Make syntax, not shell syntax.
+// mcpp resolves runtime include aliases to their real application-bundle paths,
+// which commonly contain spaces. Preserve those filenames as one prerequisite.
+static string
+quoteMakeFilename(const string &filename, bool target)
+{
+ string quoted;
+ size_t backslashes = 0;
+ for (string::const_iterator it = filename.begin(); it != filename.end(); ++it)
+ {
+ const char c = *it;
+ if (c == '\\')
+ {
+ ++backslashes;
+ continue;
+ }
+ const bool escape = c == ' ' || c == '\t' || c == '#' || c == ':'
+ || (target && c == '%');
+ quoted.append(backslashes * (escape ? 2 : 1), '\\');
+ backslashes = 0;
+ if (c == '$')
+ quoted += "$$";
+ else
+ {
+ if (escape)
+ quoted += '\\';
+ quoted += c;
+ }
+ }
+ // A trailing slash must not escape the following target/prerequisite delimiter.
+ quoted.append(backslashes * 2, '\\');
+ return quoted;
+}
+
+
void
TranslationUnit::writePrerequisites(ostream &out,
const string &dependenciesFilename,
@@ -2249,9 +2284,10 @@
if (prerequisiteFilenamesSeen.size() == 0) // if no files are depended on
return;
- out << outputFilename;
+ // Explicit -MT text keeps its documented Make-expression semantics.
+ out << (params.prerequisiteRuleTarget.empty() ? quoteMakeFilename(outputFilename, true) : outputFilename);
if (!dependenciesFilename.empty())
- out << ' ' << dependenciesFilename;
+ out << ' ' << quoteMakeFilename(dependenciesFilename, true);
out << " :";
for (vector<string>::const_iterator it = prerequisiteFilenamesSeen.begin();
@@ -2260,7 +2296,7 @@
const string &fn = *it;
if (!strncmp(fn.c_str(), pkgdatadir.c_str(), pkgdatadir.length())) // exclude system header files
continue;
- out << ' ' << fn;
+ out << ' ' << quoteMakeFilename(fn, false);
}
out << '\n';
--- a/src/Parameters.cpp
+++ b/src/Parameters.cpp
@@ -338,12 +338,16 @@
return false;
if (*p++ != '\"')
return false;
- const char *f = p;
- while (*p != '\"' && *p != '\0') // reach end of quoted string
- ++p;
+ // VCC Plus, 2026-11-03: decode escaped paths in preprocessor markers.
+ filename.clear();
+ while (*p != '\"' && *p != '\0')
+ {
+ if (*p == '\\' && (p[1] == '\\' || p[1] == '\"'))
+ ++p;
+ filename += *p++;
+ }
if (*p != '\"')
return false;
- filename.assign(f, size_t(p - f));
return true;
}
--- a/src/lexer.ll
+++ b/src/lexer.ll
@@ -71,11 +71,16 @@
*/
^\#\ [0-9]+\ \".*\"[ 0-9]*$ { sscanf(yytext + 2, "%d", &lineno);
lineno--;
- char *fn = strchr(yytext, '\"') + 1;
- char *end = strchr(fn, '\"');
- *end = '\0';
- sourceFilename = fn;
- TranslationUnit::instance().addPrerequisiteFilename(fn);
+ // VCC Plus, 2026-11-03: preserve quoted/backslash path characters.
+ const char *fn = strchr(yytext, '\"') + 1;
+ sourceFilename.clear();
+ while (*fn && *fn != '\"')
+ {
+ if (*fn == '\\' && (fn[1] == '\\' || fn[1] == '\"'))
+ ++fn;
+ sourceFilename += *fn++;
+ }
+ TranslationUnit::instance().addPrerequisiteFilename(sourceFilename.c_str());
}
/* Pragma directive. */
@@ -343,7 +348,11 @@
return false;
++r;
while (*r && *r != '\"')
+ {
+ if (*r == '\\' && (r[1] == '\\' || r[1] == '\"'))
+ ++r;
++r;
+ }
if (*r != '\"')
return false;
++r;
--- a/src/lexer.cc
+++ b/src/lexer.cc
@@ -944,11 +944,16 @@
#line 73 "lexer.ll"
{ sscanf(yytext + 2, "%d", &lineno);
lineno--;
- char *fn = strchr(yytext, '\"') + 1;
- char *end = strchr(fn, '\"');
- *end = '\0';
- sourceFilename = fn;
- TranslationUnit::instance().addPrerequisiteFilename(fn);
+ // VCC Plus, 2026-11-03: preserve quoted/backslash path characters.
+ const char *fn = strchr(yytext, '\"') + 1;
+ sourceFilename.clear();
+ while (*fn && *fn != '\"')
+ {
+ if (*fn == '\\' && (fn[1] == '\\' || fn[1] == '\"'))
+ ++fn;
+ sourceFilename += *fn++;
+ }
+ TranslationUnit::instance().addPrerequisiteFilename(sourceFilename.c_str());
}
YY_BREAK
/* Pragma directive. */
@@ -2417,7 +2422,11 @@
return false;
++r;
while (*r && *r != '\"')
+ {
+ if (*r == '\\' && (r[1] == '\\' || r[1] == '\"'))
+ ++r;
++r;
+ }
if (*r != '\"')
return false;
++r;