fix: inline accessors in slot.h now that struct fc_slot is a complete type

This commit is contained in:
Wild Dragon Dev 2026-06-03 20:11:14 +00:00
parent f318e9c501
commit 2198199a9f

View file

@ -68,11 +68,11 @@ typedef struct {
_Static_assert(sizeof(fc_frame_t) == FC_FRAME_HDR_SIZE,
"fc_frame_t header must be exactly FC_FRAME_HDR_SIZE bytes");
/* Accessor function declarations (implemented in slot.c) */
fc_header_t *fc_slot_header(struct fc_slot *s);
const char *fc_slot_id(struct fc_slot *s);
const char *fc_slot_shm_path(struct fc_slot *s);
const char *fc_slot_sem_name(struct fc_slot *s);
/* Accessor functions — inline now that struct fc_slot is defined above */
static inline fc_header_t *fc_slot_header(struct fc_slot *s) { return (fc_header_t *)s->base; }
static inline const char *fc_slot_id(struct fc_slot *s) { return s->slot_id; }
static inline const char *fc_slot_shm_path(struct fc_slot *s) { return s->shm_path; }
static inline const char *fc_slot_sem_name(struct fc_slot *s) { return s->sem_name; }
/**
* Compute total shm size for a slot given frame_size.