From 336abc2b273fe45d9864e2378a1f551805fa2f0c Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 7 Sep 2021 11:03:54 +0900 Subject: [PATCH] Fix a build on alpine, whose libc is musl (#726) Change __syscall_slong_t to __SYSCALL_SLONG_TYPE, and use it when macro __SYSCALL_SLONG_TYPE is defined. --- .../libc-wasi/sandboxed-system-primitives/src/posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c index 6b4cbe20..fd529f0b 100644 --- a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c +++ b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c @@ -2160,8 +2160,8 @@ static void convert_timestamp( struct timespec *out ) { // Store sub-second remainder. -#ifndef __APPLE__ - out->tv_nsec = (__syscall_slong_t)(in % 1000000000); +#if defined(__SYSCALL_SLONG_TYPE) + out->tv_nsec = (__SYSCALL_SLONG_TYPE)(in % 1000000000); #else out->tv_nsec = (long)(in % 1000000000); #endif