matsadler / magnus

Ruby bindings for Rust. Write Ruby extension gems in Rust, or call Ruby from Rust.
https://docs.rs/magnus/latest/magnus/
MIT License
682 stars 35 forks source link

Add support for rubies compiled with `USE_FLONUM=0`, fix `mingw` cross-compilation #27

Closed ianks closed 2 years ago

ianks commented 2 years ago

This PR makes magnus work when USE_FLONUM=0. I've verified this compiling Ruby with CPPFLAGS="-DUSE_FLONUM=0", and things are working.

As part of this work, there are a number of integration issues that I fixed by introducing a rb-sys-env crate. Incidentally, this fixes cross-compilation issues for x64-mingw32 and x64-mingw32-ucrt.

matsadler commented 2 years ago

Can you move flonum.rs to value/flonum.rs and add a pub use in value.rs? That way it will appear to be in the same module it’s always been in.

possibly at some point in the future I should reconsider the organisation, but for now all the “immediate” types, ie those directly encoded in a VALUE, live in the value model.

ianks commented 2 years ago

Yes will do that today.

ianks commented 2 years ago

This branch seems to fix windows builds for commonmarker

ianks commented 2 years ago

@matsadler Moved into value::flonum

matsadler commented 2 years ago

Awesome! Thanks for this