Skip to content

Commit

Permalink
GDExtensionCallErrorType is i32 on windows... Part 2 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanNano committed Dec 17, 2023
1 parent 1f513f6 commit 928159e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rust-script/src/script_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ where

self.call(method.as_str().into(), &args)
.map(RemoteValue::from)
// GDExtensionCallErrorType is not guaranteed to be a u32
.map_err(godot_call_error_type_to_u32)
.into()
}

Expand Down Expand Up @@ -378,3 +380,13 @@ impl<'a> RemoteValueRef<'a> {
unsafe { &*(self.ptr as *const Variant) }
}
}

#[cfg(not(target_os = "windows"))]
fn godot_call_error_type_to_u32(err: godot::sys::GDExtensionCallErrorType) -> u32 {
err
}

#[cfg(target_os = "windows")]
fn godot_call_error_type_to_u32(err: godot::sys::GDExtensionCallErrorType) -> u32 {
err as u32
}

0 comments on commit 928159e

Please sign in to comment.