Skip to content

Commit

Permalink
Use strerror_s for MSVC.
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe2933 committed May 20, 2024
1 parent 9e8e42f commit 82c1a2b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
auto vku::Shader::readCode(const std::filesystem::path &path) -> std::vector<std::uint32_t> {
std::ifstream file { path, std::ios::ate | std::ios::binary };
if (!file.is_open()) {
char buffer[256]; strerror_r(errno, buffer, 256);
char buffer[256];
#ifdef _MSC_VER
strerror_s(errno, buffer, 256);
#else
strerror_r(errno, buffer, 256);
#endif
throw std::runtime_error { std::format("Failed to open file {} ({})", path.string(), buffer) };
}

Expand Down

0 comments on commit 82c1a2b

Please sign in to comment.