Skip to content

wlroots - pointers cannot point to opaque types #5447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
leecannon opened this issue May 26, 2020 · 1 comment
Closed

wlroots - pointers cannot point to opaque types #5447

leecannon opened this issue May 26, 2020 · 1 comment

Comments

@leecannon
Copy link
Contributor

@cImporting wlroots results in:

error: C pointers cannot point to opaque types
    formats: [*c][*c]struct_wlr_drm_format,

Source of problem header

Snippet of original header

struct wlr_drm_format {
    uint32_t format;
    size_t len, cap;
    uint64_t modifiers[];
};

struct wlr_drm_format_set {
    size_t len, cap;
    struct wlr_drm_format **formats;
};

Snippet of translate-c output

pub const struct_wlr_drm_format = @Type(.Opaque); // drm_format_set.h:11:11: warning: struct demoted to opaque type - has variable length array
pub const struct_wlr_drm_format_set = extern struct {
    len: usize,
    cap: usize,
    formats: [*c][*c]struct_wlr_drm_format,
};

Is there any way of getting this working?

@Vexu
Copy link
Member

Vexu commented May 26, 2020

Duplicate of #4686, related #4775.

Easiest workaround would be to manually translate that header.

@Vexu Vexu closed this as completed May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants