Fix compilation issues with MSVC 2010

(mostly by eliminating use of range-based for loops and std::tie)
This commit is contained in:
rdb 2016-02-23 22:17:38 +01:00
parent 0967748fbc
commit 32084e889d
8 changed files with 28 additions and 28 deletions

View file

@ -689,7 +689,8 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
//
glslang::TProgram& program = *new glslang::TProgram;
for (auto compUnit : compUnits) {
for (auto it = compUnits.cbegin(); it != compUnits.cend(); ++it) {
const auto &compUnit = *it;
glslang::TShader* shader = new glslang::TShader(compUnit.stage);
shader->setStrings(compUnit.text, 1);
shaders.push_back(shader);
@ -822,8 +823,8 @@ void CompileAndLinkShaderFiles()
glslang::OS_DumpMemoryCounters();
}
for (auto c : compUnits)
FreeFileData(c.text);
for (auto it = compUnits.begin(); it != compUnits.end(); ++it)
FreeFileData(it->text);
}
int C_DECL main(int argc, char* argv[])

View file

@ -120,7 +120,8 @@ namespace {
if (fp.fail())
errHandler(std::string("error opening file for write: ") + outFile);
for (auto word : spv) {
for (auto it = spv.cbegin(); it != spv.cend(); ++it) {
SpvWord word = *it;
fp.write((char *)&word, sizeof(word));
if (fp.fail())
errHandler(std::string("error writing file: ") + outFile);
@ -157,7 +158,8 @@ namespace {
void execute(const std::vector<std::string>& inputFile, const std::string& outputDir,
int opts, int verbosity)
{
for (const auto& filename : inputFile) {
for (auto it = inputFile.cbegin(); it != inputFile.cend(); ++it) {
const std::string &filename = *it;
std::vector<SpvWord> spv;
read(spv, filename, verbosity);
spv::spirvbin_t(verbosity).remap(spv, opts);