Skip to content

Take advantage of feature(core_ffi_c) (and possibly feature(c_size_t)) #2231

Closed
@ojeda

Description

@ojeda

feature(core_ffi_c) was stabilized (and possibly feature(c_size_t) in the future), so we may want to extend --use-core to use them (gated on --rust-target or some other flag).

In fact, it could potentially be made the default, since it would work for all projects (i.e. both std and no_std).

Currently, a workaround is to manually specify the prefix via --ctypes-prefix core::ffi.

Input C/C++ Header

void f(int);

Bindgen Invocation

$ bindgen input.h --use-core

Or in the future:

$ bindgen input.h

Actual Results

extern "C" {
    pub fn f(arg1: ::std::os::raw::c_int);
}

Expected Results

extern "C" {
    pub fn f(arg1: ::core::ffi::c_int);
}

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