#![allow(clippy::missing_safety_doc, clippy::too_many_arguments, non_snake_case)]
pub mod array;
pub mod closure;
pub mod float;
pub mod fs;
pub mod int;
pub mod io;
pub mod io_error;
pub mod marshal;
pub mod model;
pub mod nat;
pub mod object;
pub mod panic;
pub mod process;
pub mod string;
pub mod thunk;
pub mod uint;
pub use array::*;
pub use closure::*;
pub use float::*;
pub use fs::*;
pub use int::*;
pub use io::*;
pub use io_error::*;
pub use marshal::*;
pub use model::*;
pub use nat::*;
pub use object::*;
pub use panic::*;
pub use process::*;
pub use string::*;
pub use thunk::*;
pub use uint::*;
pub unsafe fn lean_system_platform_nbits(_unit: Obj) -> Obj {
lean_box(usize::BITS as usize)
}
pub unsafe fn lean_system_platform_windows(_unit: Obj) -> u8 {
cfg!(windows) as u8
}
pub unsafe fn lean_system_platform_osx(_unit: Obj) -> u8 {
cfg!(target_os = "macos") as u8
}
pub unsafe fn lean_system_platform_linux(_unit: Obj) -> u8 {
cfg!(target_os = "linux") as u8
}
pub unsafe fn lean_system_platform_emscripten(_unit: Obj) -> u8 {
cfg!(target_os = "emscripten") as u8
}
pub unsafe fn lean_system_platform_target(_unit: Obj) -> Obj {
lean_mk_string(env!("LEANFRAN_TARGET"))
}
pub unsafe fn lean_internal_get_hardware_concurrency(_unit: Obj) -> u32 {
std::thread::available_parallelism().map_or(0, |n| n.get() as u32)
}
pub unsafe fn lean_ptr_addr_unsafe(a: Obj) -> usize {
lean_ptr_addr(a)
}
include!(concat!(env!("OUT_DIR"), "/externs.rs"));
#[doc(hidden)]
pub fn runtime_externs_lean() -> String {
let mut s = String::from(
"/-! C names of the functions the runtime `leanfran-runtime` provides. Generated by `make gen-externs`. -/\n\nnamespace LeanRust\n\ndef runtimeExterns : Array String := #[\n",
);
let items: Vec<String> = EXTERNS.iter().map(|n| format!(" \"{n}\"")).collect();
s.push_str(&items.join(",\n"));
s.push_str("\n]\n\nend LeanRust\n");
s
}