Skip to content

Commit

Permalink
Merge pull request #210 from AWoloszyn/fix-compilation
Browse files Browse the repository at this point in the history
Fixed compilation issue introduced by my last commit
  • Loading branch information
johnkslang committed Mar 21, 2016
2 parents 56368b6 + 272afd2 commit 5ace09a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
8 changes: 8 additions & 0 deletions glslang/MachineIndependent/Scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ class TInputScanner {
loc[getLastValidSourceIndex()].name = filename;
}

void setFile(const char* filename, size_t i)
{
if (i == getLastValidSourceIndex()) {
logicalSourceLoc.name = filename;
}
loc[i].name = filename;
}

void setString(int newString)
{
logicalSourceLoc.string = newString;
Expand Down
27 changes: 16 additions & 11 deletions glslang/MachineIndependent/preprocessor/PpContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,19 +447,24 @@ class TPpContext {
prologue_(prologue),
includedFile_(includedFile),
epilogue_(epilogue),
strings({prologue_.data(), includedFile_->file_data, epilogue_.data()}),
lengths({prologue_.size(), includedFile_->file_length, epilogue_.size()}),
names({
includedFile_->file_name.c_str(),
includedFile_->file_name.c_str(),
includedFile_->file_name.c_str()
}),
scanner(3, strings, lengths, names, 0, 0, true),
prevScanner(nullptr),
stringInput(pp, scanner) {
scanner.setLine(startLoc.line);
scanner.setString(startLoc.string);
scanner.setFile(startLoc.name);
stringInput(pp, scanner)
{
strings[0] = prologue_.data();
strings[1] = includedFile_->file_data;
strings[2] = epilogue_.data();

lengths[0] = prologue_.size();
lengths[1] = includedFile_->file_length;
lengths[2] = epilogue_.size();

scanner.setLine(startLoc.line);
scanner.setString(startLoc.string);

scanner.setFile(startLoc.name, 0);
scanner.setFile(startLoc.name, 1);
scanner.setFile(startLoc.name, 2);
}

// tInput methods:
Expand Down

0 comments on commit 5ace09a

Please sign in to comment.