From d0b060f04c4e64b7e2bced6f96deb1cfcf77c69f Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Thu, 20 Apr 2023 22:08:56 -0500 Subject: [PATCH] fixed: wasi compilation --- core/runtime/platform/wasi/platform.onyx | 4 +++- core/runtime/platform/wasi/wasi_fs.onyx | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/runtime/platform/wasi/platform.onyx b/core/runtime/platform/wasi/platform.onyx index ac8a8597..a1651cfa 100644 --- a/core/runtime/platform/wasi/platform.onyx +++ b/core/runtime/platform/wasi/platform.onyx @@ -7,7 +7,6 @@ use core use wasi use runtime -use core use wasi { IOVec, SubscriptionTagged, Subscription, Event, Size, poll_oneoff, fd_write, fd_datasync, fd_read, @@ -18,6 +17,9 @@ use runtime { __runtime_initialize, Multi_Threading_Enabled, } +use core { + __flush_stdio +} // Platform supports diff --git a/core/runtime/platform/wasi/wasi_fs.onyx b/core/runtime/platform/wasi/wasi_fs.onyx index c2dfe65a..954b2552 100644 --- a/core/runtime/platform/wasi/wasi_fs.onyx +++ b/core/runtime/platform/wasi/wasi_fs.onyx @@ -1,11 +1,9 @@ package runtime.platform use runtime -use core +use core {package, *} use wasi -use core - #if runtime.runtime != .Wasi { #error "The file system library is currently only available on the WASI runtime, and should only be included if that is the chosen runtime." } @@ -311,7 +309,7 @@ __dir_read :: (dir: DirectoryData, out_entry: &os.DirectoryEntry) -> bool { out_entry.identifier = ~~dirent.d_ino; out_entry.name_length = dirent.d_namlen; memory.set(~~&out_entry.name_data, 0, 256); - memory.copy(~~&out_entry.name_data, ~~(dirent + 1), math.min(dirent.d_namlen, sizeof typeof out_entry.name_data)); + memory.copy(~~&out_entry.name_data, ~~(cast([&] wasi.DirEnt, dirent) + 1), math.min(dirent.d_namlen, sizeof typeof out_entry.name_data)); dir.last_cookie = dirent.d_next; return true; -- 2.25.1