PP #include non-functional: consistent notation for "header" and "header name".
This is versus a variety of file-related language, designated, requested, etc. Will simplify diffs for next commit.
This commit is contained in:
parent
927608b393
commit
2508602541
4 changed files with 23 additions and 23 deletions
|
|
@ -607,14 +607,14 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
|
|||
// Process well-formed directive
|
||||
TShader::Includer::IncludeResult* res = includer.include(filename.c_str(), includeType, currentSourceFile.c_str(),
|
||||
includeStack.size() + 1);
|
||||
if (res && !res->file_name.empty()) {
|
||||
if (res->file_data && res->file_length) {
|
||||
if (res && !res->headerName.empty()) {
|
||||
if (res->headerData && res->headerLength) {
|
||||
// path for processing one or more tokens from an included header, hand off 'res'
|
||||
const bool forNextLine = parseContext.lineDirectiveShouldSetNextLine();
|
||||
std::ostringstream prologue;
|
||||
std::ostringstream epilogue;
|
||||
prologue << "#line " << forNextLine << " " << "\"" << res->file_name << "\"\n";
|
||||
epilogue << (res->file_data[res->file_length - 1] == '\n'? "" : "\n") <<
|
||||
prologue << "#line " << forNextLine << " " << "\"" << res->headerName << "\"\n";
|
||||
epilogue << (res->headerData[res->headerLength - 1] == '\n'? "" : "\n") <<
|
||||
"#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n";
|
||||
pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this));
|
||||
// There's no "current" location anymore.
|
||||
|
|
@ -626,7 +626,7 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
|
|||
} else {
|
||||
// error path, clean up
|
||||
std::string message =
|
||||
res ? std::string(res->file_data, res->file_length)
|
||||
res ? std::string(res->headerData, res->headerLength)
|
||||
: std::string("Could not process include directive");
|
||||
parseContext.ppError(directiveLoc, message.c_str(), "#include", "for header name: %s", filename.c_str());
|
||||
includer.releaseInclude(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue