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.
This commit is contained in:
Wenyong Huang 2023-09-26 16:13:12 +08:00 committed by GitHub
parent 6382162711
commit ade73f6142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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