(ident)
| 369 | |
| 370 | // Returns the C function with a specified identifier (for C++, you need to do manual name mangling) |
| 371 | function getCFunc(ident) { |
| 372 | var func = Module['_' + ident]; // closure exported function |
| 373 | if (!func) { |
| 374 | try { |
| 375 | func = eval('_' + ident); // explicit lookup |
| 376 | } catch(e) {} |
| 377 | } |
| 378 | assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)'); |
| 379 | return func; |
| 380 | } |
| 381 | |
| 382 | var cwrap, ccall; |
| 383 | (function(){ |