rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Support for raw-dylib for Windows

Open tbu- opened this issue 1 year ago • 0 comments

Currently, the following is generated:

extern "C" {
    #[doc = "[…]"]
    pub fn wmem_alloc(allocator: *mut wmem_allocator_t, size: usize)
        -> *mut ::std::os::raw::c_void;
}

I'd like to have an extra attribute there, for compilation to Windows:

#[cfg_attr(windows, link(name = "libwsutil.dll", kind = "raw-dylib"))]
extern "C" {
    #[doc = "[…]"]
    pub fn wmem_alloc(allocator: *mut wmem_allocator_t, size: usize)
        -> *mut ::std::os::raw::c_void;
}

tbu- avatar May 15 '24 23:05 tbu-