Refactor clock functions to use WASI types (#2666)

Refactoring the clock functions to use WASI types so we can simplify the
code and remove some unnecessary boilerplate. See
https://github.com/bytecodealliance/wasm-micro-runtime/pull/2637#discussion_r1362202879
for details.
This commit is contained in:
zoraaver
2023-10-25 11:06:04 +01:00
committed by GitHub
parent 75208073c0
commit e7a62d2099
14 changed files with 188 additions and 228 deletions

View File

@ -29,15 +29,16 @@ file (GLOB source_all ${PLATFORM_SHARED_DIR}/*.c)
if (NOT WAMR_BUILD_LIBC_WASI EQUAL 1)
add_definitions(-DSGX_DISABLE_WASI)
else()
list(APPEND source_all ${PLATFORM_SHARED_DIR}/../common/posix/posix_file.c)
list(APPEND source_all
${PLATFORM_SHARED_DIR}/../common/posix/posix_file.c
${PLATFORM_SHARED_DIR}/../common/posix/posix_clock.c
)
include (${CMAKE_CURRENT_LIST_DIR}/../common/libc-util/platform_common_libc_util.cmake)
set(source_all ${source_all} ${PLATFORM_COMMON_LIBC_UTIL_SOURCE})
endif()
file (GLOB source_all_untrusted ${PLATFORM_SHARED_DIR}/untrusted/*.c)
list(APPEND source_all ${PLATFORM_SHARED_DIR}/../common/posix/posix_clock.c)
set (PLATFORM_SHARED_SOURCE ${source_all})
set (PLATFORM_SHARED_SOURCE_UNTRUSTED ${source_all_untrusted})