Closed JupiterRider closed 7 months ago
Yeah I noticed & fixed this when working on struct support. The fix is probably worth merging now instead of waiting for my struct PR to be complete.
Thank you very much! :)
Also, fyi there is a safer way to convert the bit representation to a float using math.Float32frombits and it's 64bit equivalent.
Also, fyi there is a safer way to convert the bit representation to a float using math.Float32frombits and it's 64bit equivalent.
Ah ok. So you mean, when converting from uintptr to float?
Ah ok. So you mean, when converting from uintptr to float?
Yes. In your second example instead of using unsafe you could've just done:
math.Float32frombits(ret)
The test fails on 0.5. I'll revert the cherry-pick on 0.5 once.
https://github.com/ebitengine/purego/actions/runs/6915374716/job/18814228166
It seems to be because 0.5 doesn't have #63 which added callbacks on Linux which the float tests need.
You can tell because the other callback tests are skipped.
You can tell because the other callback tests are skipped.
Sure!
Done: 930b6648e1294aae39e60c46b48e971ca4e4bf1a
This one always returns zero:
When using the syscall package like this, it works: