From: Brendan Hansen Date: Fri, 21 Apr 2023 03:08:56 +0000 (-0500) Subject: fixed: wasi compilation X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=d0b060f04c4e64b7e2bced6f96deb1cfcf77c69f;p=onyx.git fixed: wasi compilation --- 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;