cwrap() can also do some simple type conversions, for JS strings to C
strings and JS arrays to C arrays, see

https://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html#cwrap

Just calling the function directly means that you use types available in
asm.js and wasm, which are just integers and floats, and no special support
for strings or arrays (for example a C string is just a pointer, which is
just an integer).

On Sat, Nov 24, 2018 at 8:36 PM Robert Aboukhalil <
[email protected]> wrote:

> Hi there,
>
> I noticed that when I export a C function using -s
> EXPORTED_FUNCTIONS="['_test']", I'm able to call that function by just
> running _test() instead of cwrap() as mentioned in the documentation.
>
> Since using _test() is much easier, I'm wondering whether there are any
> differences to doing it that way vs using cwrap()?
>
> Thanks!
>
> Robert
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to