diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-30 17:34:08 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-30 17:34:08 -0700 |
commit | 4b94e181cb4ff08b26264c34ed6818f5a3fd2225 (patch) | |
tree | 455a0c2ef21e8b0b756f57c3f924ab54b1bfb981 | |
parent | 0a8eb75c785208f20c230ecdde0a7034cf70a84a (diff) |
refactor DEFAULT_LIBRARY_FUNCS_TO_INCLUDE
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rw-r--r-- | src/settings.js | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 2aa65980..78f48118 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -71,7 +71,7 @@ function JSify(data, functionsOnly, givenFunctions) { } } } else { - libFuncsToInclude = ['memcpy', 'memset', 'malloc', 'free', '$Browser']; + libFuncsToInclude = DEFAULT_LIBRARY_FUNCS_TO_INCLUDE; } libFuncsToInclude.forEach(function(ident) { data.functionStubs.push({ diff --git a/src/settings.js b/src/settings.js index 7e7caa6f..03c84eae 100644 --- a/src/settings.js +++ b/src/settings.js @@ -193,6 +193,15 @@ var PROFILE = 0; // Enables runtime profiling. See test_profiling for a usage ex var EXPORTED_FUNCTIONS = ['_main', '_malloc', '_free']; // Functions that are explicitly exported, so they are guaranteed to // be accessible outside of the generated code even after running closure compiler. + // Note the necessary prefix of "_". + +var DEFAULT_LIBRARY_FUNCS_TO_INCLUDE = ['memcpy', 'memset', 'malloc', 'free', '$Browser']; // JS library functions (C functions implemented in JS) + // that we include by default. If you want to make sure + // something is included by the JS compiler, add it here. + // For example, if you do not use some emscripten_* + // C API call from C, but you want to call it from JS, + // add it here (and in EXPORTED FUNCTIONS with prefix + // "_", for closure). var IGNORED_FUNCTIONS = []; // Functions that we should not generate, neither a stub nor a complete function. // This is useful if your project code includes a function, and you want to replace |