mirror of
https://github.com/janet-lang/janet
synced 2024-11-24 09:17:17 +00:00
Check for __GLIBC__ instead of _GNU_SOURCE
musl doesn't obey this behavior.
This commit is contained in:
parent
fda0a081f5
commit
a5d6b22838
@ -972,7 +972,7 @@ const char *janet_strerror(int e) {
|
|||||||
#ifdef JANET_WINDOWS
|
#ifdef JANET_WINDOWS
|
||||||
/* Microsoft strerror seems sane here and is thread safe by default */
|
/* Microsoft strerror seems sane here and is thread safe by default */
|
||||||
return strerror(e);
|
return strerror(e);
|
||||||
#elif defined(_GNU_SOURCE)
|
#elif defined(__GLIBC__)
|
||||||
/* See https://linux.die.net/man/3/strerror_r */
|
/* See https://linux.die.net/man/3/strerror_r */
|
||||||
return strerror_r(e, janet_vm.strerror_buf, sizeof(janet_vm.strerror_buf));
|
return strerror_r(e, janet_vm.strerror_buf, sizeof(janet_vm.strerror_buf));
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user