Skip to content

Commit

Permalink
Merge pull request #328 from DenisBiryukov91/fix/arm32_build
Browse files Browse the repository at this point in the history
fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t for arm32
  • Loading branch information
milyin authored Apr 12, 2024
2 parents 817fe38 + 258fbd1 commit 4ece6dc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 8 additions & 1 deletion include/zenoh_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ typedef struct ALIGN(8) z_owned_reply_t {
#endif
#if defined(TARGET_ARCH_ARM)
typedef struct ALIGN(8) z_owned_reply_t {
uint64_t _0[19];
uint64_t _0[21];
} z_owned_reply_t;
#endif
/**
Expand Down Expand Up @@ -936,9 +936,16 @@ typedef struct zcu_owned_closure_matching_status_t {
*
* To check if `val` is still valid, you may use `z_X_check(&val)` or `z_check(val)` if your compiler supports `_Generic`, which will return `true` if `val` is valid.
*/
#if !defined(TARGET_ARCH_ARM)
typedef struct ALIGN(8) zcu_owned_matching_listener_t {
uint64_t _0[4];
} zcu_owned_matching_listener_t;
#endif
#if defined(TARGET_ARCH_ARM)
typedef struct ALIGN(4) zcu_owned_matching_listener_t {
uint32_t _0[4];
} zcu_owned_matching_listener_t;
#endif
/**
* An owned zenoh publication_cache.
*
Expand Down
2 changes: 1 addition & 1 deletion src/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct z_owned_reply_t([u64; 30]);

#[cfg(target_arch = "arm")]
#[repr(C, align(8))]
pub struct z_owned_reply_t([u64; 19]);
pub struct z_owned_reply_t([u64; 21]);

impl_guarded_transmute!(noderefs ReplyInner, z_owned_reply_t);

Expand Down
4 changes: 4 additions & 0 deletions src/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,12 @@ pub extern "C" fn z_publisher_keyexpr(publisher: z_publisher_t) -> z_owned_keyex
/// After a move, `val` will still exist, but will no longer be valid. The destructors are double-drop-safe, but other functions will still trust that your `val` is valid.
///
/// To check if `val` is still valid, you may use `z_X_check(&val)` or `z_check(val)` if your compiler supports `_Generic`, which will return `true` if `val` is valid.
#[cfg(not(target_arch = "arm"))]
#[repr(C, align(8))]
pub struct zcu_owned_matching_listener_t([u64; 4]);
#[cfg(target_arch = "arm")]
#[repr(C, align(4))]
pub struct zcu_owned_matching_listener_t([u32; 4]);

impl_guarded_transmute!(noderefs
Option<MatchingListener<'_, ()>>,
Expand Down

0 comments on commit 4ece6dc

Please sign in to comment.