Working commit
This commit is contained in:
@@ -32,7 +32,7 @@ unsafe extern "C" fn __is_utf8(ptr: *const u8, len: usize) -> bool {
|
||||
}
|
||||
|
||||
const CACHE_LIBS: &[(&str, &str)] = &[
|
||||
// preloaded
|
||||
// libs in global
|
||||
("table", "table"),
|
||||
("string", "string"),
|
||||
("math", "math"),
|
||||
@@ -143,13 +143,18 @@ impl Registry {
|
||||
}
|
||||
|
||||
pub fn declare<T: Type>(&mut self, name: impl Display) -> &mut Self {
|
||||
self.include::<T>();
|
||||
self.funcs
|
||||
self.include::<T>()
|
||||
.funcs
|
||||
.insert(name.to_string())
|
||||
.then(|| writeln!(self.cdef, "{};", T::cdecl(name)).unwrap());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn preload<T: Type>(&mut self, name: impl Display) -> &mut Self {
|
||||
self.include::<T>();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn done(&self) -> String {
|
||||
self.to_string()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user