From ade73f6142a1a11202053219b840580eeb24750e Mon Sep 17 00:00:00 2001 From: Wenyong Huang Date: Tue, 26 Sep 2023 16:13:12 +0800 Subject: [PATCH] Fix compilation error on Android platform (#2594) The CI might use clang-17 to build iwasm for Android platform and it may report compilation error: https://github.com/bytecodealliance/wasm-micro-runtime/actions/runs/6308980430/job/17128073777 /home/runner/work/wasm-micro-runtime/wasm-micro-runtime/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/blocking_op.c:45:19: error: call to undeclared function 'preadv'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] ssize_t ret = preadv(fd, iov, iovcnt, offset); ^ Explicitly declare preadv and pwritev in android platform header file to resolve it. --- core/shared/platform/android/platform_internal.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/shared/platform/android/platform_internal.h b/core/shared/platform/android/platform_internal.h index d718a2d7..c28a7b9b 100644 --- a/core/shared/platform/android/platform_internal.h +++ b/core/shared/platform/android/platform_internal.h @@ -139,16 +139,12 @@ seekdir(DIR *__dir, long __location); #endif -#if __ANDROID_API__ < 24 - ssize_t preadv(int __fd, const struct iovec *__iov, int __count, off_t __offset); ssize_t pwritev(int __fd, const struct iovec *__iov, int __count, off_t __offset); -#endif - #ifdef __cplusplus } #endif