Currently when it is called, it will crash due to the wrong argument type being specified.
Specifically, it should be an enum called EFindName, which looks like this:
enum EFindName {
FNAME_FIND,
FNAME_ADD,
}
The enum value we want is EFindName::FNAME_FIND.
The function with this type will be as follows:
impl<T: Into<FString>> From<T> for FName {
fn from(s: T) -> FName {
let s = s.into();
let mut name = FName::NAME_None;
unsafe {
let fun: extern_fn!(fn(this: *mut FName, name: *const TCHAR, find_type: EFindName) -> u64)
= mem::transmute(FNAME_FNAME.load(Ordering::SeqCst));
fun(&mut name as *mut FName, s.as_ptr(), EFindName::FNAME_FIND);
}
name
}
}
Currently when it is called, it will crash due to the wrong argument type being specified. Specifically, it should be an enum called
EFindName
, which looks like this:The enum value we want is
EFindName::FNAME_FIND
.The function with this type will be as follows: