I'm trying to reference a
extern const C struct in Swift code to pass to another C function which expects a pointer to the struct, but have been unable to do so.
The definition is:
extern const struct wl_interface wl_compositor_interface;
and the function header is:
static void* wl_registry_bind( struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version )
My code is:
window._compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1)
but I get a
cannot pass immutable value as inout argument: 'wl_compositor_interface' is a 'let' constant error.
I've posted a bug about this (https://bugs.swift.org/browse/SR-9589) explaining the specifics due to a compiler crash I uncovered while trying to figure out how to achieve this, but thought I'd post here to see if there was a way to achieve it curently.