Skip to content

Commit d3a6236

Browse files
bors[bot]Supreeeme
andauthored
Merge #243
243: Switch to c_char for string methods r=Bromeon a=Supreeeme Fixes Android build. Co-authored-by: Supreeeme <yungwallace@live.com>
2 parents 3c81e8c + a7fc6f5 commit d3a6236

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

godot-core/src/builtin/string/godot_string.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
55
*/
66

7-
use std::{convert::Infallible, fmt, str::FromStr};
7+
use std::{convert::Infallible, ffi::c_char, fmt, str::FromStr};
88

99
use godot_ffi as sys;
1010
use sys::types::OpaqueString;
@@ -169,7 +169,11 @@ where
169169
unsafe {
170170
Self::from_string_sys_init(|string_ptr| {
171171
let ctor = interface_fn!(string_new_with_utf8_chars_and_len);
172-
ctor(string_ptr, bytes.as_ptr() as *const i8, bytes.len() as i64);
172+
ctor(
173+
string_ptr,
174+
bytes.as_ptr() as *const c_char,
175+
bytes.len() as i64,
176+
);
173177
})
174178
}
175179
}
@@ -186,7 +190,7 @@ impl From<&GodotString> for String {
186190

187191
interface_fn!(string_to_utf8_chars)(
188192
string.string_sys(),
189-
buf.as_mut_ptr() as *mut i8,
193+
buf.as_mut_ptr() as *mut c_char,
190194
len,
191195
);
192196

0 commit comments

Comments
 (0)