Files
RedBear-OS/src/cxa.rs
T
jD91mZM2 c7d499d4f2 Upgrade to the 2018 edition
I didn't think it'd be this useful first, but thank god for `cargo fix --edition`!
2019-08-04 19:05:45 +02:00

29 lines
642 B
Rust

use crate::platform::types::*;
// TODO: Implement cxa_finalize and uncomment this
#[derive(Clone, Copy)]
struct CxaAtExitFunc {
//func: extern "C" fn(*mut c_void),
//arg: *mut c_void,
//dso: *mut c_void,
}
static mut CXA_ATEXIT_FUNCS: [Option<CxaAtExitFunc>; 32] = [None; 32];
#[no_mangle]
pub unsafe extern "C" fn __cxa_atexit(
func_opt: Option<extern "C" fn(*mut c_void)>,
arg: *mut c_void,
dso: *mut c_void,
) -> c_int {
for item in &mut CXA_ATEXIT_FUNCS {
if item.is_none() {
*item = func_opt.map(|func| CxaAtExitFunc {} /*{ func, arg, dso }*/);
return 0;
}
}
-1
}