diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-01 10:43:03 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-01 10:43:03 -0800 |
commit | 6181442a104dd74fb2da8298e28c8a78f2195da5 (patch) | |
tree | 26333f9af21b69454e31baea2d8186a68189c9ec /src/preamble.js | |
parent | c523f984fca8a8f0ffcdbad0c6b1305a30033edb (diff) |
update ccall docs
Diffstat (limited to 'src/preamble.js')
-rw-r--r-- | src/preamble.js | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/preamble.js b/src/preamble.js index e24c2957..6cf87753 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -308,18 +308,10 @@ var globalScope = this; // defined with extern "C"). // // Note: LLVM optimizations can inline and remove functions, after which you will not be -// able to call them. Adding +// able to call them. Closure can also do so. To avoid that, add your function to +// the exports using something like // -// __attribute__((used)) -// -// to the function definition will prevent that. -// -// Note: Closure optimizations will minify function names, making -// functions no longer callable. If you run closure (on by default -// in -O2 and above), you should export the functions you will call -// by calling emcc with something like -// -// -s EXPORTED_FUNCTIONS='["_func1","_func2"]' +// -s EXPORTED_FUNCTIONS='["_main", "_myfunc"]' // // @param ident The name of the C function (note that C++ functions will be name-mangled - use extern "C") // @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and |