|
6 | 6 | #include <pthread.h> |
7 | 7 | #include <math.h> |
8 | 8 |
|
| 9 | +#if defined(__linux__) && !defined(__GLIBC__) |
| 10 | +// musl compatibility for glibc-linked libraries (e.g. libv8-node) |
| 11 | +// some versions of libv8-node are accidentally linked against glibc symbols |
| 12 | +// or compiled with a toolchain that emits these C23 compatibility symbols |
| 13 | +unsigned long long __isoc23_strtoull(const char *nptr, char **endptr, int base) { |
| 14 | + return strtoull(nptr, endptr, base); |
| 15 | +} |
| 16 | +unsigned long __isoc23_strtoul(const char *nptr, char **endptr, int base) { |
| 17 | + return strtoul(nptr, endptr, base); |
| 18 | +} |
| 19 | +long long __isoc23_strtoll(const char *nptr, char **endptr, int base) { |
| 20 | + return strtoll(nptr, endptr, base); |
| 21 | +} |
| 22 | +long __isoc23_strtol(const char *nptr, char **endptr, int base) { |
| 23 | + return strtol(nptr, endptr, base); |
| 24 | +} |
| 25 | +double __isoc23_strtod(const char *nptr, char **endptr) { |
| 26 | + return strtod(nptr, endptr); |
| 27 | +} |
| 28 | +float __isoc23_strtof(const char *nptr, char **endptr) { |
| 29 | + return strtof(nptr, endptr); |
| 30 | +} |
| 31 | +#endif |
| 32 | + |
9 | 33 | #include "ruby.h" |
10 | 34 | #include "ruby/encoding.h" |
11 | 35 | #include "ruby/version.h" |
|
0 commit comments