From 088de1f9a92b72ef1d182a36a6cecfcdf0c4d9a4 Mon Sep 17 00:00:00 2001 From: wackbyte Date: Thu, 25 Jan 2024 01:22:39 -0500 Subject: [PATCH] Use `c_char` instead of `i8` where necessary Aarch64 Linux has [`c_char` as `u8` rather than `i8`](https://doc.rust-lang.org/1.75.0/src/core/ffi/mod.rs.html#99) as the code expects. This fixes the build there. --- client/src/graphics/base.rs | 4 ++-- client/src/graphics/voxels/surface_extraction.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/graphics/base.rs b/client/src/graphics/base.rs index ef2ed3c4..1ebe8acf 100644 --- a/client/src/graphics/base.rs +++ b/client/src/graphics/base.rs @@ -1,6 +1,6 @@ //! Common state shared throughout the graphics system -use std::ffi::CStr; +use std::ffi::{c_char, CStr}; use std::path::PathBuf; use std::sync::Arc; use std::{fs, io, ptr}; @@ -111,7 +111,7 @@ impl Base { .device_name .iter() .position(|&x| x == 0) - .unwrap()] as *const [i8] as *const [u8]), + .unwrap()] as *const [c_char] as *const [u8]), ) .unwrap(); info!(name, "selected device"); diff --git a/client/src/graphics/voxels/surface_extraction.rs b/client/src/graphics/voxels/surface_extraction.rs index 1c797225..4f21bd6e 100644 --- a/client/src/graphics/voxels/surface_extraction.rs +++ b/client/src/graphics/voxels/surface_extraction.rs @@ -1,3 +1,4 @@ +use std::ffi::c_char; use std::{mem, ptr}; use ash::{vk, Device}; @@ -109,7 +110,7 @@ impl SurfaceExtraction { .map_entries(&specialization_map_entries) .data(as_bytes(&WORKGROUP_SIZE)); - let p_name = b"main\0".as_ptr() as *const i8; + let p_name = b"main\0".as_ptr() as *const c_char; let mut pipelines = device .create_compute_pipelines( gfx.pipeline_cache,