fix cross compile for aarch64

This commit is contained in:
sijie.sun
2025-01-24 21:56:48 +08:00
parent a5f4b4e3a0
commit 1f3af9d332
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -25,5 +25,5 @@ tracing-subscriber = "0.3.19"
rand = "0.8.5"
[build-dependencies]
bindgen = "0.71.1"
bindgen = { version="0.71.1", default-features=true}
cc = "1.2.10"
+3 -3
View File
@@ -111,7 +111,7 @@ impl Kcp {
}
pub fn handle_input(&mut self, data: &[u8]) -> Result<(), Error> {
let ret = unsafe { ikcp_input(self.kcp, data.as_ptr() as *const i8, data.len() as i64) };
let ret = unsafe { ikcp_input(self.kcp, data.as_ptr() as *const _, data.len() as _) };
if ret < 0 {
return Err(anyhow::anyhow!("input failed, return: {}", ret).into());
} else {
@@ -132,7 +132,7 @@ impl Kcp {
}
pub fn send(&mut self, data: Bytes) -> Result<usize, Error> {
let ret = unsafe { ikcp_send(self.kcp, data.as_ptr() as *const i8, data.len() as i32) };
let ret = unsafe { ikcp_send(self.kcp, data.as_ptr() as *const _, data.len() as _) };
if ret < 0 {
return Err(anyhow::anyhow!("send failed, return: {}", ret).into());
} else {
@@ -152,7 +152,7 @@ impl Kcp {
pub fn recv(&mut self, buf: &mut BytesMut) -> Result<(), Error> {
let ret =
unsafe { ikcp_recv(self.kcp, buf.as_mut_ptr() as *mut i8, buf.capacity() as i32) };
unsafe { ikcp_recv(self.kcp, buf.as_mut_ptr() as *mut _, buf.capacity() as _) };
if ret < 0 {
return Err(anyhow::anyhow!("recv failed, return: {}", ret).into());
} else {