Apply clang-format for core/shared and product-mini files (#785)
Apply clang-format for core/shared and product-mini files
This commit is contained in:
@ -19,10 +19,10 @@ bh_platform_init()
|
||||
|
||||
void
|
||||
bh_platform_destroy()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
int os_printf(const char *fmt, ...)
|
||||
int
|
||||
os_printf(const char *fmt, ...)
|
||||
{
|
||||
int ret;
|
||||
va_list ap;
|
||||
@ -34,14 +34,16 @@ int os_printf(const char *fmt, ...)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int os_vprintf(const char *fmt, va_list ap)
|
||||
int
|
||||
os_vprintf(const char *fmt, va_list ap)
|
||||
{
|
||||
return __android_log_vprint(ANDROID_LOG_INFO, "wasm_runtime::", fmt, ap);
|
||||
}
|
||||
|
||||
#if __ANDROID_API__ < 19
|
||||
|
||||
int futimens(int __dir_fd, const struct timespec __times[2])
|
||||
int
|
||||
futimens(int __dir_fd, const struct timespec __times[2])
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(futimens, 19);
|
||||
return -1;
|
||||
@ -51,32 +53,37 @@ int futimens(int __dir_fd, const struct timespec __times[2])
|
||||
|
||||
#if __ANDROID_API__ < 21
|
||||
|
||||
int posix_fallocate(int __fd, off_t __offset, off_t __length)
|
||||
int
|
||||
posix_fallocate(int __fd, off_t __offset, off_t __length)
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(posix_fallocate, 21);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int posix_fadvise(int fd, off_t offset, off_t len, int advice)
|
||||
int
|
||||
posix_fadvise(int fd, off_t offset, off_t len, int advice)
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(posix_fadvise, 21);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int linkat(int __old_dir_fd, const char *__old_path,
|
||||
int __new_dir_fd, const char *__new_path, int __flags)
|
||||
int
|
||||
linkat(int __old_dir_fd, const char *__old_path, int __new_dir_fd,
|
||||
const char *__new_path, int __flags)
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(linkat, 21);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int symlinkat(const char *__old_path, int __new_dir_fd, const char *__new_path)
|
||||
int
|
||||
symlinkat(const char *__old_path, int __new_dir_fd, const char *__new_path)
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(symlinkat, 21);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t readlinkat(int __dir_fd, const char *__path, char *__buf, size_t __buf_size)
|
||||
ssize_t
|
||||
readlinkat(int __dir_fd, const char *__path, char *__buf, size_t __buf_size)
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(readlinkat, 21);
|
||||
return -1;
|
||||
@ -86,13 +93,15 @@ ssize_t readlinkat(int __dir_fd, const char *__path, char *__buf, size_t __buf_s
|
||||
|
||||
#if __ANDROID_API__ < 23
|
||||
|
||||
long telldir(DIR *__dir)
|
||||
long
|
||||
telldir(DIR *__dir)
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(telldir, 23);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void seekdir(DIR *__dir, long __location)
|
||||
void
|
||||
seekdir(DIR *__dir, long __location)
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(seekdir, 23);
|
||||
}
|
||||
@ -101,13 +110,15 @@ void seekdir(DIR *__dir, long __location)
|
||||
|
||||
#if __ANDROID_API__ < 24
|
||||
|
||||
ssize_t preadv(int __fd, const struct iovec *__iov, int __count, off_t __offset)
|
||||
ssize_t
|
||||
preadv(int __fd, const struct iovec *__iov, int __count, off_t __offset)
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(preadv, 24);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t pwritev(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)
|
||||
{
|
||||
API_NOT_SUPPORT_ERROR(pwritev, 24);
|
||||
return -1;
|
||||
|
||||
@ -59,10 +59,8 @@ typedef pthread_t korp_thread;
|
||||
#define os_thread_local_attribute __thread
|
||||
|
||||
#if WASM_DISABLE_HW_BOUND_CHECK == 0
|
||||
#if defined(BUILD_TARGET_X86_64) \
|
||||
|| defined(BUILD_TARGET_AMD_64) \
|
||||
|| defined(BUILD_TARGET_AARCH64) \
|
||||
|| defined(BUILD_TARGET_RISCV64_LP64D) \
|
||||
#if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64) \
|
||||
|| defined(BUILD_TARGET_AARCH64) || defined(BUILD_TARGET_RISCV64_LP64D) \
|
||||
|| defined(BUILD_TARGET_RISCV64_LP64)
|
||||
|
||||
#include <setjmp.h>
|
||||
@ -79,15 +77,20 @@ typedef jmp_buf korp_jmpbuf;
|
||||
|
||||
typedef void (*os_signal_handler)(void *sig_addr);
|
||||
|
||||
int os_thread_signal_init(os_signal_handler handler);
|
||||
int
|
||||
os_thread_signal_init(os_signal_handler handler);
|
||||
|
||||
void os_thread_signal_destroy();
|
||||
void
|
||||
os_thread_signal_destroy();
|
||||
|
||||
bool os_thread_signal_inited();
|
||||
bool
|
||||
os_thread_signal_inited();
|
||||
|
||||
void os_signal_unmask();
|
||||
void
|
||||
os_signal_unmask();
|
||||
|
||||
void os_sigreturn();
|
||||
void
|
||||
os_sigreturn();
|
||||
#endif /* end of BUILD_TARGET_X86_64/AMD_64/AARCH64/RISCV64 */
|
||||
#endif /* end of WASM_DISABLE_HW_BOUND_CHECK */
|
||||
|
||||
@ -95,38 +98,48 @@ typedef long int __syscall_slong_t;
|
||||
|
||||
#if __ANDROID_API__ < 19
|
||||
|
||||
int futimens(int __dir_fd, const struct timespec __times[2]);
|
||||
int
|
||||
futimens(int __dir_fd, const struct timespec __times[2]);
|
||||
|
||||
#endif
|
||||
|
||||
#if __ANDROID_API__ < 21
|
||||
|
||||
int posix_fallocate(int __fd, off_t __offset, off_t __length);
|
||||
int
|
||||
posix_fallocate(int __fd, off_t __offset, off_t __length);
|
||||
|
||||
int posix_fadvise(int fd, off_t offset, off_t len, int advice);
|
||||
int
|
||||
posix_fadvise(int fd, off_t offset, off_t len, int advice);
|
||||
|
||||
int linkat(int __old_dir_fd, const char *__old_path,
|
||||
int __new_dir_fd, const char *__new_path, int __flags);
|
||||
int
|
||||
linkat(int __old_dir_fd, const char *__old_path, int __new_dir_fd,
|
||||
const char *__new_path, int __flags);
|
||||
|
||||
int symlinkat(const char *__old_path, int __new_dir_fd, const char *__new_path);
|
||||
int
|
||||
symlinkat(const char *__old_path, int __new_dir_fd, const char *__new_path);
|
||||
|
||||
ssize_t readlinkat(int __dir_fd, const char *__path, char *__buf, size_t __buf_size);
|
||||
ssize_t
|
||||
readlinkat(int __dir_fd, const char *__path, char *__buf, size_t __buf_size);
|
||||
|
||||
#endif
|
||||
|
||||
#if __ANDROID_API__ < 23
|
||||
|
||||
long telldir(DIR *__dir);
|
||||
long
|
||||
telldir(DIR *__dir);
|
||||
|
||||
void seekdir(DIR *__dir, long __location);
|
||||
void
|
||||
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
|
||||
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);
|
||||
ssize_t
|
||||
pwritev(int __fd, const struct iovec *__iov, int __count, off_t __offset);
|
||||
|
||||
#endif
|
||||
|
||||
@ -135,4 +148,3 @@ ssize_t pwritev(int __fd, const struct iovec *__iov, int __count, off_t __offset
|
||||
#endif
|
||||
|
||||
#endif /* end of _PLATFORM_INTERNAL_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user