mmomtchev / swig

This is SWIG JavaScript Evolution, a fork of the SWIG project with modern JavaScript/TypeScript support including WASM and async
http://www.swig.org
Other
11 stars 1 forks source link

Generating for WASM should not require `-D__EMSCRIPTEN__` #31

Closed mmomtchev closed 7 months ago

mmomtchev commented 7 months ago

According to the manual, SWIG should generate identical wrappers for Node.js native and WASM.

Currently, WASM requires -D__EMSCRIPTEN__ because some typemaps expand __EMSCRIPTEN__ during the generation and not the compilation.

mmomtchev commented 7 months ago

As a consequence, with 5.0.2, and unless -D__EMSCRIPTEN__ is specified, (void **arraybuffer_data, size_t *arraybuffer_len) does not copy the data when compiling to WASM