Skip to content

Commit

Permalink
fix build granularity
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Oct 17, 2024
1 parent 65f6927 commit 6921d69
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
47 changes: 31 additions & 16 deletions include/zenoh-pico/api/handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,37 @@ extern "C" {
/* elem_drop_f */ z_##item_name##_drop, \
/* elem_null */ z_internal_##item_name##_null)

#define _Z_CHANNEL_DEFINE_DUMMY(item_name, kind_name) \
typedef struct { \
uint8_t _foo; \
} z_owned_##kind_name##_handler_##item_name##_t; \
typedef struct { \
uint8_t _foo; \
} z_loaned_##kind_name##_handler_##item_name##_t; \
typedef struct { \
z_owned_##kind_name##_handler_##item_name##_t *_ptr; \
} z_moved_##kind_name##_handler_##item_name##_t; \
void *z_##kind_name##_handler_##item_name##_loan(void); \
void *z_##kind_name##_handler_##item_name##_move(void); \
void *z_##kind_name##_handler_##item_name##_drop(void); \
void *z_##kind_name##_handler_##item_name##_recv(void); \
void *z_##kind_name##_handler_##item_name##_take(void); \
void *z_##kind_name##_handler_##item_name##_try_recv(void);
#define _Z_CHANNEL_DUMMY_IMPL(handler_type, handler_name, item_name) \
_Z_OWNED_TYPE_VALUE(handler_type, handler_name) \
static inline void _z_##handler_name##_clear(handler_type *handler) { _ZP_UNUSED(handler); } \
static inline bool _z_##handler_name##_check(const handler_type *handler) { \
_ZP_UNUSED(handler); \
return false; \
} \
static inline handler_type _z_##handler_name##_null(void) { \
handler_type h = {0}; \
return h; \
} \
_Z_OWNED_FUNCTIONS_VALUE_NO_COPY_INLINE_IMPL(handler_type, handler_name, _z_##handler_name##_check, \
_z_##handler_name##_null, _z_##handler_name##_clear) \
static inline z_result_t z_##handler_name##_try_recv(const z_loaned_##handler_name##_t *handler, \
z_owned_##item_name##_t *e) { \
_ZP_UNUSED(handler); \
_ZP_UNUSED(e); \
return Z_CHANNEL_DISCONNECTED; \
} \
static inline z_result_t z_##handler_name##_recv(const z_loaned_##handler_name##_t *handler, \
z_owned_##item_name##_t *e) { \
_ZP_UNUSED(handler); \
_ZP_UNUSED(e); \
return Z_CHANNEL_DISCONNECTED; \
}

#define _Z_CHANNEL_DEFINE_DUMMY(item_name, kind_name) \
typedef struct { \
uint8_t _foo; \
} _z_##kind_name##_handler_##item_name##_t; \
_Z_CHANNEL_DUMMY_IMPL(_z_##kind_name##_handler_##item_name##_t, kind_name##_handler_##item_name, item_name)

// This macro defines:
// z_ring_channel_sample_new()
Expand Down
2 changes: 2 additions & 0 deletions src/api/encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,6 @@ z_result_t z_encoding_to_string(const z_loaned_encoding_t *encoding, z_owned_str
return _Z_RES_OK;
}

#if Z_FEATURE_ENCODING_VALUES == 1
const z_loaned_encoding_t *z_encoding_loan_default(void) { return z_encoding_zenoh_bytes(); }
#endif
2 changes: 1 addition & 1 deletion zenohpico.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ prefix=/usr/local
Name: zenohpico
Description:
URL:
Version: 1.0.20241004dev
Version: 1.0.20241017dev
Cflags: -I${prefix}/include
Libs: -L${prefix}/lib -lzenohpico

0 comments on commit 6921d69

Please sign in to comment.