We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 783fe3d commit 24db6b8Copy full SHA for 24db6b8
source/matplot/util/popen.cpp
@@ -189,13 +189,13 @@ int common_pipe::close(int *exit_code)
189
190
inline int common_pipe::report(int code, const std::string& what)
191
{
192
-#ifdef __STDC_LIB_EXT1__
+#if defined(__STDC_LIB_EXT1__) || defined(_MSC_VER)
193
char buffer[128]{}; // MSVC has no strerrorlen_s
194
strerror_s(buffer, 128, code); // MSVC rejects strerror
195
error_ = what + ": " + buffer;
196
#else
197
error_ = what + ": " + std::strerror(code); // GCC fixed strerror and has no strerror_s
198
-#endif
+#endif // __STDC_LIB_EXT1__ or MSVC
199
if (exceptions_)
200
throw std::system_error{code, std::generic_category(), what};
201
return code;
0 commit comments