Skip to content

Feature request: Customize pointer types #2023

Open
@tbodt

Description

@tbodt

I'd like to be able to customize the types of pointer types generated by bindgen. That is, the input:

struct foo {
    int *bar;
};

would produce the output:

struct foo {
    pub bar: CustomPointer<::std::os::raw::c_int>,
}

where CustomPointer is an arbitrary type path specified in configuration.

The idea here is the custom pointer type can be a safe transparent wrapper around an integer value, which can e.g. treat the pointer as belonging to another process and read it from there.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions