diff --git a/spa/include/spa/support/system.h b/spa/include/spa/support/system.h index 3d287da04..56ceea648 100644 --- a/spa/include/spa/support/system.h +++ b/spa/include/spa/support/system.h @@ -59,8 +59,15 @@ struct spa_system { struct spa_interface iface; }; struct spa_poll_event { uint32_t events; - void *data; -} __attribute__ ((packed)); + union { + void *data; + uint64_t data_u64; + }; +#ifdef __x86_64__ +} __attribute__((packed)); +#else +}; +#endif struct spa_system_methods { #define SPA_VERSION_SYSTEM_METHODS 1 diff --git a/spa/plugins/support/system.c b/spa/plugins/support/system.c index d48636e2e..cd9e1c6eb 100644 --- a/spa/plugins/support/system.c +++ b/spa/plugins/support/system.c @@ -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;