Skip to content

Commit 529a2fc

Browse files
bors[bot]toasteater
andauthored
Merge #599
599: Fix pointer type for class name to *const c_char r=toasteater a=toasteater The type of c_char is different depending on the target platform. On most platforms this is `i8`, but on Android it's `u8` instead. This caused type mismatch errors when building for Android. Using the `libc` type alias should fix this. Close #571 Co-authored-by: toasteater <[email protected]>
2 parents 677684c + 64c49fe commit 529a2fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gdnative-core/src/private.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ macro_rules! make_method_table {
198198

199199
#[inline(never)]
200200
fn init(table: &mut Self, api: &sys::GodotApi) {
201-
const CLASS_NAME: *const i8 = concat!(stringify!($class), "\0").as_ptr() as *const i8;
201+
const CLASS_NAME: *const libc::c_char = concat!(stringify!($class), "\0").as_ptr() as *const libc::c_char;
202202

203203
unsafe {
204-
$(table.$methods = (api.godot_method_bind_get_method)(CLASS_NAME, concat!(stringify!($methods), "\0").as_ptr() as *const i8);)*
204+
$(table.$methods = (api.godot_method_bind_get_method)(CLASS_NAME, concat!(stringify!($methods), "\0").as_ptr() as *const libc::c_char);)*
205205
}
206206
}
207207
}

0 commit comments

Comments
 (0)