Skip to content

Commit

Permalink
OpenBSD - Update strict_fstream.hpp
Browse files Browse the repository at this point in the history
The OpenBSD definition of "strerror_r", similar to FreeBSD, returns an `int` rather than a `char *`. This commit includes `__OpenBSD__` in the list of defines to check for this function call.
  • Loading branch information
ron-at-swgy authored May 30, 2024
1 parent 13363c9 commit 193e607
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extern/zstr/strict_fstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static std::string strerror()
} else {
return "Unknown error (" + std::to_string(err_num) + ")";
}
#elif ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__APPLE__) || defined(__FreeBSD__)) && ! _GNU_SOURCE) || defined(__MUSL__)
#elif ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && ! _GNU_SOURCE) || defined(__MUSL__)
// XSI-compliant strerror_r()
const int err_num = errno; // See above
if (strerror_r(err_num, buff.data(), buff.size()) == 0) {
Expand Down

0 comments on commit 193e607

Please sign in to comment.