Skip to content

Commit 6181442

Browse files
committed
update ccall docs
1 parent c523f98 commit 6181442

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

src/preamble.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -308,18 +308,10 @@ var globalScope = this;
308308
// defined with extern "C").
309309
//
310310
// Note: LLVM optimizations can inline and remove functions, after which you will not be
311-
// able to call them. Adding
311+
// able to call them. Closure can also do so. To avoid that, add your function to
312+
// the exports using something like
312313
//
313-
// __attribute__((used))
314-
//
315-
// to the function definition will prevent that.
316-
//
317-
// Note: Closure optimizations will minify function names, making
318-
// functions no longer callable. If you run closure (on by default
319-
// in -O2 and above), you should export the functions you will call
320-
// by calling emcc with something like
321-
//
322-
// -s EXPORTED_FUNCTIONS='["_func1","_func2"]'
314+
// -s EXPORTED_FUNCTIONS='["_main", "_myfunc"]'
323315
//
324316
// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern "C")
325317
// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and

0 commit comments

Comments
 (0)