From b3627fa4a407a4d71be7e367a30e490a862206d2 Mon Sep 17 00:00:00 2001 From: Oleksandr Tankieiev Date: Fri, 23 Oct 2026 14:59:51 +0300 Subject: [PATCH 1/2] fix ASIO struct layout --- azo-sys/src/lib.rs | 14 +++++++------- azo-sys/src/utils.rs | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/azo-sys/src/lib.rs b/azo-sys/src/lib.rs index 576e3df..2a4ba5f 100644 --- a/azo-sys/src/lib.rs +++ b/azo-sys/src/lib.rs @@ -139,8 +139,8 @@ impl ResultCode { } } -#[repr(C)] -#[derive(Debug, Clone, PartialEq)] +#[repr(C, packed(4))] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct TimeCode { pub speed: c_double, pub time_code_samples: Samples, @@ -182,8 +182,8 @@ bitflags! { } } -#[repr(C)] -#[derive(Debug, Default, Clone, PartialEq)] +#[repr(C, packed(4))] +#[derive(Debug, Default, Clone, Copy, PartialEq)] pub struct TimeInfo { pub speed : c_double, pub system_time : TimeStamp, @@ -207,7 +207,7 @@ bitflags! { } } -#[repr(C)] +#[repr(C, packed(4))] #[derive(Debug, Default, Clone, PartialEq)] pub struct Time { pub _reserved: [c_long; 4], @@ -246,7 +246,7 @@ pub type BufferSwitchTimeInfo = direct_process : Bool ) -> *mut Time; -#[repr(C)] +#[repr(C, packed(4))] #[derive(Debug, Clone, Hash)] pub struct Callbacks { pub buffer_switch : BufferSwitch, @@ -359,7 +359,7 @@ pub struct ChannelInfo { pub name : [u8; 32] } -#[repr(C)] +#[repr(C, packed(4))] #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct BufferInfo { pub is_input : Bool, diff --git a/azo-sys/src/utils.rs b/azo-sys/src/utils.rs index f0c430a..95f5ed7 100644 --- a/azo-sys/src/utils.rs +++ b/azo-sys/src/utils.rs @@ -56,6 +56,7 @@ macro_rules! c_enum { } } +#[repr(C)] #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] pub struct I64Split { pub hi: u32, From f274878cbb56de71d62037bcce402fa42f5982cf Mon Sep 17 00:00:00 2001 From: LastExceed Date: Fri, 23 Oct 2026 17:52:25 +0200 Subject: [PATCH 2/2] infer `Time`'s align implicitly to avoid its components having to be `Copy` --- azo-sys/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azo-sys/src/lib.rs b/azo-sys/src/lib.rs index 2a4ba5f..422e3f0 100644 --- a/azo-sys/src/lib.rs +++ b/azo-sys/src/lib.rs @@ -140,7 +140,7 @@ impl ResultCode { } #[repr(C, packed(4))] -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, PartialEq)] pub struct TimeCode { pub speed: c_double, pub time_code_samples: Samples, @@ -183,7 +183,7 @@ bitflags! { } #[repr(C, packed(4))] -#[derive(Debug, Default, Clone, Copy, PartialEq)] +#[derive(Debug, Default, Clone, PartialEq)] pub struct TimeInfo { pub speed : c_double, pub system_time : TimeStamp, @@ -207,7 +207,7 @@ bitflags! { } } -#[repr(C, packed(4))] +#[repr(C)] #[derive(Debug, Default, Clone, PartialEq)] pub struct Time { pub _reserved: [c_long; 4],