Emscripten: Cast pointer arguments to pointer-sized integers#1113
Emscripten: Cast pointer arguments to pointer-sized integers#1113TheComputerGuy96 wants to merge 1 commit intomackron:devfrom
Conversation
For some reason, 64-bit pointer arguments are casted to Numbers in Emscripten's type handling (which causes conversion errors when passing them back to native code)
|
Without digging into this at all, I am wondering if the original casting to unsigned integers has to do with comparing pointers. There are intrinsics for handling that in a standard manner, rather than faking integers (and assuming x64 :). |
|
Here's a related Emscripten issue: emscripten-core/emscripten#26625 |
|
@TheComputerGuy96 Thanks for this. Do you by chance know if this will break the build for older versions of Emscripten? Is this a build error or a runtime error by the way? |
Emscripten versions since 3.1.15 should be fine with the MEMORY64 flag set (due to emscripten-core/emscripten@a0ed598) while 32-bit isn't really affected
As mentioned in the Emscripten issue, this is a runtime error (specifically |
|
Thanks. I think this should be fine. Will look at this properly when I do my next pass on miniaudio, but can't see any reason not to merge it so long as it doesn't break older builds (3.1.15 is well old enough). |
For some reason, 64-bit pointer arguments are casted to Numbers in Emscripten's type handling (which causes conversion errors when passing them back to native code)