Skip to content

Commit

Permalink
Check for __GLIBC__ instead of _GNU_SOURCE
Browse files Browse the repository at this point in the history
musl doesn't obey this behavior.
  • Loading branch information
bakpakin committed Jun 21, 2024
1 parent fda0a08 commit a5d6b22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ const char *janet_strerror(int e) {
#ifdef JANET_WINDOWS
/* Microsoft strerror seems sane here and is thread safe by default */
return strerror(e);
#elif defined(_GNU_SOURCE)
#elif defined(__GLIBC__)
/* See https://linux.die.net/man/3/strerror_r */
return strerror_r(e, janet_vm.strerror_buf, sizeof(janet_vm.strerror_buf));
#else
Expand Down

0 comments on commit a5d6b22

Please sign in to comment.