snuk182 / nuklear-rust

The bindings to the Nuklear 2D immediate GUI library.
Apache License 2.0
359 stars 16 forks source link

Crash on i686 target #27

Closed lynnux closed 4 years ago

lynnux commented 4 years ago

At first, I build the gdi demo by nightly-x86_64-pc-windows-msvc, all good, but got crash when build by nightly-i686-pc-windows-msvc. And I debugged to figure out the crash palce is nk_init, relate to nk_handle. In nuklear-sys-4.0.4:

pub union nk_handle {
    pub ptr: *mut ::std::os::raw::c_void,
    pub id: ::std::os::raw::c_int,
    _bindgen_union_align: u64,   
}

this cause nk_handle take 8 bytes in i686 build, but the C def is

typedef union {void *ptr; int id;} nk_handle;

it only take 4 bytes in i686 build, so that's the problem!

snuk182 commented 4 years ago

Hi @lynnux , thanks for the ticket.

Bindgen is so Bindgen, unfortunately. I hope to get a x86 machine/VM ASAP and look closer onto the whole family of such issues. Of course, if you have a solution, I always appreciate a MR.

snuk182 commented 4 years ago

Hi @lynnux , couldn't you please update the deps and give a try?

lynnux commented 4 years ago

@snuk182 thanks, it 's working great!