From ecd83ed3136015c80d646dc609243586c7371e41 Mon Sep 17 00:00:00 2001 From: Anthony Pesch Date: Tue, 30 Jul 2013 10:00:46 -0700 Subject: Update test_ccall to not use a postrun hook --- src/preamble.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/preamble.js') diff --git a/src/preamble.js b/src/preamble.js index 218e0388..61188f52 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -729,6 +729,20 @@ function exitRuntime() { callRuntimeCallbacks(__ATEXIT__); } +Module['addOnInit'] = function addOnInit(cb) { + __ATINIT__.unshift(cb); +}; + +Module['addOnPreMain'] = function addOnPreMain(cb) { + __ATMAIN__.unshift(cb); +}; + +Module['addOnExit'] = function addOnExit(cb) { + __ATEXIT__.unshift(cb); +}; + +// TODO add onprerun, onpostrun + // Tools // This processes a JS string into a C-line array of numbers, 0-terminated. -- cgit v1.2.3-18-g5258