hecl/Compilers: Convert fprintf calls over to fmt::print

Makes the Metal code more consistent with the other compilers. While
we're at it we can also fix accidental printf leftovers within the
existing fmt format strings.
This commit is contained in:
Lioncash 2019-08-23 11:53:35 -04:00
parent 73cf8df409
commit d59d453db3
1 changed files with 5 additions and 5 deletions

View File

@ -167,7 +167,7 @@ struct ShaderCompiler<PlatformType::Metal> {
"-gline-tables-only", "-MO", "-gline-tables-only", "-MO",
#endif #endif
"-", NULL); "-", NULL);
fprintf(stderr, "execlp fail %s\n", strerror(errno)); fmt::print(stderr, fmt("execlp fail {}\n"), strerror(errno));
exit(1); exit(1);
} }
close(compilerIn[0]); close(compilerIn[0]);
@ -183,7 +183,7 @@ struct ShaderCompiler<PlatformType::Metal> {
/* metallib doesn't like outputting to a pipe, so temp file will have to do */ /* metallib doesn't like outputting to a pipe, so temp file will have to do */
execlp("xcrun", "xcrun", "-sdk", "macosx", "metallib", "-", "-o", libFile.c_str(), NULL); execlp("xcrun", "xcrun", "-sdk", "macosx", "metallib", "-", "-o", libFile.c_str(), NULL);
fprintf(stderr, "execlp fail %s\n", strerror(errno)); fmt::print(stderr, fmt("execlp fail {}\n"), strerror(errno));
exit(1); exit(1);
} }
close(compilerOut[0]); close(compilerOut[0]);
@ -194,7 +194,7 @@ struct ShaderCompiler<PlatformType::Metal> {
while (inRem) { while (inRem) {
ssize_t writeRes = write(compilerIn[1], inPtr, inRem); ssize_t writeRes = write(compilerIn[1], inPtr, inRem);
if (writeRes < 0) { if (writeRes < 0) {
fprintf(stderr, "write fail %s\n", strerror(errno)); fmt::print(stderr, fmt("write fail {}\n"), strerror(errno));
break; break;
} }
inPtr += writeRes; inPtr += writeRes;
@ -207,7 +207,7 @@ struct ShaderCompiler<PlatformType::Metal> {
while (waitpid(compilerPid, &compilerStat, 0) < 0) { while (waitpid(compilerPid, &compilerStat, 0) < 0) {
if (errno == EINTR) if (errno == EINTR)
continue; continue;
Log.report(logvisor::Fatal, fmt("waitpid fail %s"), strerror(errno)); Log.report(logvisor::Fatal, fmt("waitpid fail {}"), strerror(errno));
return {}; return {};
} }
@ -219,7 +219,7 @@ struct ShaderCompiler<PlatformType::Metal> {
while (waitpid(linkerPid, &linkerStat, 0) < 0) { while (waitpid(linkerPid, &linkerStat, 0) < 0) {
if (errno == EINTR) if (errno == EINTR)
continue; continue;
Log.report(logvisor::Fatal, fmt("waitpid fail %s"), strerror(errno)); Log.report(logvisor::Fatal, fmt("waitpid fail {}"), strerror(errno));
return {}; return {};
} }