Skip to content

Commit 2ec8656

Browse files
authored
Merge pull request #872 from nobodywho-ooo/android-fix-cstr-to-string
Fix android builds: use std::ffi::c_char in cstr_to_string
2 parents 48ce8f8 + bb10875 commit 2ec8656

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llama-cpp-2/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//!
1414
//! - `cuda` enables CUDA gpu support.
1515
//! - `sampler` adds the [`context::sample::sampler`] struct for a more rusty way of sampling.
16-
use std::ffi::NulError;
16+
use std::ffi::{c_char, NulError};
1717
use std::fmt::Debug;
1818
use std::num::NonZeroI32;
1919

@@ -398,7 +398,7 @@ pub struct LlamaBackendDevice {
398398
pub fn list_llama_ggml_backend_devices() -> Vec<LlamaBackendDevice> {
399399
let mut devices = Vec::new();
400400
for i in 0..unsafe { llama_cpp_sys_2::ggml_backend_dev_count() } {
401-
fn cstr_to_string(ptr: *const i8) -> String {
401+
fn cstr_to_string(ptr: *const c_char) -> String {
402402
if ptr.is_null() {
403403
String::new()
404404
} else {

0 commit comments

Comments
 (0)