Skip to content

Commit 2755e80

Browse files
committed
build with shm passed
1 parent 1ac56fa commit 2755e80

File tree

7 files changed

+299
-136
lines changed

7 files changed

+299
-136
lines changed

include/zenoh_commons.h

Lines changed: 148 additions & 112 deletions
Large diffs are not rendered by default.

include/zenoh_macros.h

Lines changed: 131 additions & 1 deletion
Large diffs are not rendered by default.

src/shm/buffer/zshm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ use crate::{
2525
};
2626

2727
decl_c_type!(
28-
owned(z_owned_shm_t, Option<ZShm>),
28+
owned(z_owned_shm_t, option ZShm),
2929
loaned(z_loaned_shm_t, zshm),
30-
moved(z_moved_shm_t, ZShm)
30+
moved(z_moved_shm_t)
3131
);
3232

3333
/// Constructs ZShm slice from ZShmMut slice

src/shm/buffer/zshmmut.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ use crate::{
2222
};
2323

2424
decl_c_type!(
25-
owned(z_owned_shm_mut_t, Option<ZShmMut>),
25+
owned(z_owned_shm_mut_t, option ZShmMut),
2626
loaned(z_loaned_shm_mut_t, zshmmut),
27-
moved(z_moved_shm_mut_t, ZShmMut)
27+
moved(z_moved_shm_mut_t)
2828
);
2929

3030
/// Tries to construct ZShmMut slice from ZShm slice

src/shm/client/shm_client.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ pub struct zc_shm_client_callbacks_t {
4242
) -> bool,
4343
}
4444

45-
decl_c_type!(owned(z_owned_shm_client_t, Option<Arc<dyn ShmClient>>),
46-
moved (z_moved_shm_client_t, Arc<dyn ShmClient>)
45+
decl_c_type!(
46+
owned(z_owned_shm_client_t, option Arc<dyn ShmClient>),
47+
moved(z_moved_shm_client_t)
4748
);
4849

4950
#[derive(Debug)]

src/shm/provider/alloc_layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub enum CSHMLayout {
4848
}
4949

5050
decl_c_type!(
51-
owned(z_owned_alloc_layout_t, Option<CSHMLayout>),
52-
loaned(z_loaned_alloc_layout_t, CSHMLayout),
51+
owned(z_owned_alloc_layout_t, option CSHMLayout),
52+
loaned(z_loaned_alloc_layout_t),
5353
moved(z_moved_alloc_layout_t)
5454
);
5555

src/shm/provider/types.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,10 @@ pub struct z_alloc_alignment_t {
7272

7373
decl_c_type!(copy(z_alloc_alignment_t, AllocAlignment),);
7474

75-
decl_c_type!(
76-
inequal
77-
owned(z_owned_memory_layout_t,
78-
Option<MemoryLayout>),
79-
loaned(z_loaned_memory_layout_t, MemoryLayout),
80-
moved(z_moved_memory_layout_t)
75+
decl_c_type_inequal!(
76+
owned(z_owned_memory_layout_t, option MemoryLayout),
77+
loaned(z_loaned_memory_layout_t),
78+
moved(z_moved_memory_layout_t)
8179
);
8280

8381
/// Creates a new Memory Layout
@@ -141,9 +139,9 @@ pub extern "C" fn z_memory_layout_get_data(
141139
}
142140

143141
decl_c_type!(
144-
owned(z_owned_chunk_alloc_result_t, Option<ChunkAllocResult>),
145-
loaned(z_loaned_chunk_alloc_result_t, ChunkAllocResult),
146-
moved(z_moved_chunk_alloc_result_t)
142+
owned(z_owned_chunk_alloc_result_t, option ChunkAllocResult),
143+
loaned(z_loaned_chunk_alloc_result_t),
144+
moved(z_moved_chunk_alloc_result_t)
147145
);
148146

149147
/// Creates a new Chunk Alloc Result with Ok value
@@ -195,12 +193,10 @@ pub unsafe extern "C" fn z_chunk_alloc_result_loan(
195193
#[allow(unused_variables)]
196194
pub extern "C" fn z_chunk_alloc_result_drop(this: z_moved_chunk_alloc_result_t) {}
197195

198-
decl_c_type!(
199-
inequal
200-
owned(z_owned_buf_alloc_result_t,
201-
Option<BufAllocResult>),
202-
loaned(z_loaned_buf_alloc_result_t, BufAllocResult),
203-
moved(z_moved_buf_alloc_result_t)
196+
decl_c_type_inequal!(
197+
owned(z_owned_buf_alloc_result_t, option BufAllocResult),
198+
loaned(z_loaned_buf_alloc_result_t),
199+
moved(z_moved_buf_alloc_result_t)
204200
);
205201

206202
#[no_mangle]

0 commit comments

Comments
 (0)