Skip to content

Commit 336abc2

Browse files
authored
Fix a build on alpine, whose libc is musl (bytecodealliance#726)
Change __syscall_slong_t to __SYSCALL_SLONG_TYPE, and use it when macro __SYSCALL_SLONG_TYPE is defined.
1 parent 79f163d commit 336abc2

File tree

1 file changed

+2
-2
lines changed
  • core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src

1 file changed

+2
-2
lines changed

core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2160,8 +2160,8 @@ static void convert_timestamp(
21602160
struct timespec *out
21612161
) {
21622162
// Store sub-second remainder.
2163-
#ifndef __APPLE__
2164-
out->tv_nsec = (__syscall_slong_t)(in % 1000000000);
2163+
#if defined(__SYSCALL_SLONG_TYPE)
2164+
out->tv_nsec = (__SYSCALL_SLONG_TYPE)(in % 1000000000);
21652165
#else
21662166
out->tv_nsec = (long)(in % 1000000000);
21672167
#endif

0 commit comments

Comments
 (0)