Skip to content

Commit

Permalink
generate 2.222.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lebedec committed May 20, 2024
1 parent f0543af commit ad91aee
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libfmod"
version = "2.222.1"
version = "2.222.2"
publish = true
edition = "2021"
license = "MIT"
Expand Down
20 changes: 14 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,22 @@ macro_rules! opt_ptr {
}
macro_rules! to_vec {
($ ptr : expr , $ length : expr , $ closure : expr) => {
slice::from_raw_parts($ptr, $length as usize)
.to_vec()
.into_iter()
.map($closure)
.collect::<Result<Vec<_>, Error>>()
if $length == 0 {
Ok(vec![])
} else {
slice::from_raw_parts($ptr, $length as usize)
.to_vec()
.into_iter()
.map($closure)
.collect::<Result<Vec<_>, Error>>()
}
};
($ ptr : expr , $ length : expr) => {
slice::from_raw_parts($ptr, $length as usize).to_vec()
if $length == 0 {
vec![]
} else {
slice::from_raw_parts($ptr, $length as usize).to_vec()
}
};
}
macro_rules! to_bool {
Expand Down
8 changes: 8 additions & 0 deletions tests/examples/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ use libfmod::ffi::{
};
use libfmod::{DspDescription, DspParameterDesc, DspParameterType, Error, System};

#[test]
fn test_system_advanced_settings_before_init() -> Result<(), Error> {
let system = System::create()?;
let settings = system.get_advanced_settings()?;
println!("Settings: {:?}", settings);
system.release()
}

#[test]
fn test_dsp_custom() -> Result<(), Error> {
let system = System::create()?;
Expand Down

0 comments on commit ad91aee

Please sign in to comment.