Fix issue #676: emit error message on failure to open spv file.
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp
index 5b1240c..4014525 100755
--- a/SPIRV/GlslangToSpv.cpp
+++ b/SPIRV/GlslangToSpv.cpp
@@ -5319,6 +5319,8 @@
{
std::ofstream out;
out.open(baseName, std::ios::binary | std::ios::out);
+ if (out.fail())
+ printf("ERROR: Failed to open file: %s\n", baseName);
for (int i = 0; i < (int)spirv.size(); ++i) {
unsigned int word = spirv[i];
out.write((const char*)&word, 4);
@@ -5331,6 +5333,8 @@
{
std::ofstream out;
out.open(baseName, std::ios::binary | std::ios::out);
+ if (out.fail())
+ printf("ERROR: Failed to open file: %s\n", baseName);
out << "\t// " GLSLANG_REVISION " " GLSLANG_DATE << std::endl;
if (varName != nullptr) {
out << "\t #pragma once" << std::endl;