Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mrb_float() doesnt work with MRB_32BIT unless boxing_word.h is included #5595

Open
sasq64 opened this issue Dec 11, 2021 · 4 comments
Open

Comments

@sasq64
Copy link
Contributor

sasq64 commented Dec 11, 2021

If MRB_32BIT is defined MRB_WORDBOX_NO_FLOAT_TRUNCATE will also be defined in boxing_word.h, and
mrb_word_boxing_value_float(mrb_value v) will not be available.
But that only happens if you include boxing_word.h, and so the mrb_float(o) macro will not see the TRUNCATE define and
generate a call to the wrong function...

@sasq64
Copy link
Contributor Author

sasq64 commented Dec 11, 2021

Actually I was just using MRB_INT32 before... is MRB_32BIT a new flag ?

@dearblue
Copy link
Contributor

is MRB_32BIT a new flag ?

No, it is automatically defined when the run-time target is 32-bit (e.g. ARMv7, i386, ...).

It is not expected to define MRB_32BIT for 64-bit environments.
It may be desirable to get an error.

@sasq64
Copy link
Contributor Author

sasq64 commented Dec 11, 2021

I cross compile to Emscripten, where intts are always 32-bit so I want that to be true on all target systems preferably...

@matz
Copy link
Member

matz commented Dec 15, 2021

Could you show us the configuration file and the actual error messages, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants