Skip to content

Commit 24db6b8

Browse files
committed
MSVC is not following any standards
1 parent 783fe3d commit 24db6b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/matplot/util/popen.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,13 @@ int common_pipe::close(int *exit_code)
189189

190190
inline int common_pipe::report(int code, const std::string& what)
191191
{
192-
#ifdef __STDC_LIB_EXT1__
192+
#if defined(__STDC_LIB_EXT1__) || defined(_MSC_VER)
193193
char buffer[128]{}; // MSVC has no strerrorlen_s
194194
strerror_s(buffer, 128, code); // MSVC rejects strerror
195195
error_ = what + ": " + buffer;
196196
#else
197197
error_ = what + ": " + std::strerror(code); // GCC fixed strerror and has no strerror_s
198-
#endif
198+
#endif // __STDC_LIB_EXT1__ or MSVC
199199
if (exceptions_)
200200
throw std::system_error{code, std::generic_category(), what};
201201
return code;

0 commit comments

Comments
 (0)