moved all crates into seperate folder + related path fixes

This commit is contained in:
Anton-4 2022-07-01 17:37:43 +02:00
parent 12ef03bb86
commit eee85fa45d
No known key found for this signature in database
GPG key ID: C954D6E0F9C0ABFD
1063 changed files with 92 additions and 93 deletions

View file

@ -0,0 +1,18 @@
// Rust's libc crate doesn't support Wasm, so we provide an implementation from Zig
// We define Rust signatures here as we need them, rather than trying to cover all of libc
#[cfg(target_family = "wasm")]
use core::ffi::c_void;
#[cfg(target_family = "wasm")]
extern "C" {
pub fn malloc(size: usize) -> *mut c_void;
pub fn free(p: *mut c_void);
pub fn realloc(p: *mut c_void, size: usize) -> *mut c_void;
pub fn memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void;
pub fn memset(dst: *mut c_void, ch: i32, n: usize) -> *mut c_void;
}
// Tell users of this crate where to find the Wasm .a file
// If a non-Wasm target is using this crate, we assume it is a build script that wants to emit Wasm
// For Wasm target, it won't ever be used, but we expose it just to keep things simple
mod generated;
pub use generated::{WASI_COMPILER_RT_PATH, WASI_LIBC_PATH};