RustAudio / rust-jack

Rust bindings for JACK. A realtime sound server for audio and midi IO
http://rustaudio.github.io/rust-jack/
MIT License
211 stars 33 forks source link

rust-jack doesn't compile on ARM #74

Closed Mousterian closed 6 years ago

Mousterian commented 6 years ago

Hi I want to use rust-jack for some projects on raspberry pi, but it doesn't compile at present - there's a few places in the code where it uses i8 as a char type, but on ARM char is defined as u8.

Example error:

pi@raspberrypi:~/dev/rust/rust-jack $ cargo build Compiling jack v0.5.3 (file:///home/pi/dev/rust/rust-jack) error[E0308]: mismatched types --> src/client/base.rs:270:26 270 collect_strs(ports) ^^^^^ expected i8, found u8

= note: expected type *const *const i8 found type *mut *const u8

I think it's quite simple to fix, it looks like should be using libc::c_char which will be defined appropriately on each architecture, so in the case of jack_utils::collect_strs the signature would change from:

pub unsafe fn collect_strs(ptr: *const *const i8) -> Vec<String> {

to:

pub unsafe fn collect_strs(ptr: *const *const libc::c_char) -> Vec<String> {

I have the changes and tests passing locally on raspbian already - how do you guys like to work on this repo - can I raise a pull request, or should I fork the repo?

wmedrano commented 6 years ago

Yes, raise a pull request. Should be good to submit if the tests pass on TravisCI which runs automatically on PRs.