paullouisageneau / datachannel-wasm

C++ WebRTC Data Channels and WebSockets for WebAssembly in browsers
MIT License
148 stars 25 forks source link

Replace dynamic dynCall by makeDynCall macro #39

Closed paullouisageneau closed 2 years ago

paullouisageneau commented 2 years ago

It appears dynCall has been converted into a library function in https://github.com/emscripten-core/emscripten/issues/12002 therefore datachannel-wasm should add an explicit dependency on '$dynCall' to ensure it is present at runtime.

However, it seems better to remove the reliance on the dynCall API entirely. This PR replaces dynamic dynCall usage by the makeDynCall macro, as the macro looks widely used in emscripten JS libraries and is de-facto public as explained in https://github.com/emscripten-core/emscripten/pull/12732. It removes the dependency on the runtime method and should perform better.

Fixes the possible need for -sDYNCALLS=1 described in https://github.com/paullouisageneau/datachannel-wasm/issues/38