spa: system: make spa_poll_event compatible with epoll_events

spa_poll_event should have exactly same layout as epoll_events to be
compatible across platforms. The structure is packed only on x86-64.

Fix packing and replace the data member with similar union as
epoll_data, to fix compatibility on 32-bit etc.
This commit is contained in:
Pauli Virtanen 2026-04-06 10:24:34 +03:00 committed by Wim Taymans
parent 6b0248d68c
commit ad0bab69a1
2 changed files with 11 additions and 2 deletions

View file

@ -31,6 +31,8 @@ SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.system");
#endif
SPA_STATIC_ASSERT(sizeof(struct spa_poll_event) == sizeof(struct epoll_event));
SPA_STATIC_ASSERT(offsetof(struct spa_poll_event, events) == offsetof(struct epoll_event, events));
SPA_STATIC_ASSERT(offsetof(struct spa_poll_event, data) == offsetof(struct epoll_event, data.ptr));
struct impl {
struct spa_handle handle;