diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-07-24 18:38:13 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-24 18:38:13 +0530 |
commit | 58d1126fa43ac429d4fcdfc3914abf1ccca93bc5 (patch) | |
tree | 30103109173e6cc8f491e5e2325c25a3111bc30a /ext/ffi/lib.rs | |
parent | f8fee6cd21cce82d6c34e539d39da86df7b036f7 (diff) |
chore(ext/ffi): remove dependency on stdint.h (#15294)
Diffstat (limited to 'ext/ffi/lib.rs')
-rw-r--r-- | ext/ffi/lib.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index 6d0315964..a03bb41d6 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -10,13 +10,11 @@ use deno_core::futures::channel::mpsc; use deno_core::futures::Future; use deno_core::include_js_files; use deno_core::op; -use deno_core::v8::fast_api; -use std::sync::mpsc::sync_channel; - use deno_core::serde_json::json; use deno_core::serde_json::Value; use deno_core::serde_v8; use deno_core::v8; +use deno_core::v8::fast_api; use deno_core::Extension; use deno_core::OpState; use deno_core::Resource; @@ -33,17 +31,30 @@ use std::cell::RefCell; use std::collections::HashMap; use std::ffi::c_void; use std::ffi::CStr; +use std::mem::size_of; use std::os::raw::c_char; +use std::os::raw::c_short; use std::path::Path; use std::path::PathBuf; use std::ptr; use std::rc::Rc; +use std::sync::mpsc::sync_channel; #[cfg(not(target_os = "windows"))] mod jit_trampoline; #[cfg(not(target_os = "windows"))] mod tcc; +#[cfg(not(target_pointer_width = "64"))] +compile_error!("platform not supported"); + +// Assert assumptions made in `prelude.h` +const _: () = { + assert!(size_of::<c_char>() == 1); + assert!(size_of::<c_short>() == 2); + assert!(size_of::<*const ()>() == 8); +}; + thread_local! { static LOCAL_ISOLATE_POINTER: RefCell<*const v8::Isolate> = RefCell::new(ptr::null()); } |