diff --git a/emscripten.py b/emscripten.py index ab6a2dd5f7b6e..673da1102ea5b 100755 --- a/emscripten.py +++ b/emscripten.py @@ -1289,7 +1289,7 @@ def create_exports(exported_implemented_functions, in_table, function_table_data exports.append(quote(str(k)) + ': ' + str(v)) # shared wasm emulated function pointer mode requires us to know the function pointer for # each function. export fp$func => function pointer for func - if shared.Settings.WASM and shared.Settings.RELOCATABLE and shared.Settings.EMULATED_FUNCTION_POINTERS: + if shared.Settings.WASM and shared.Settings.RELOCATABLE and shared.Settings.EMULATE_FUNCTION_POINTER_CASTS: for k, v in metadata['functionPointers'].items(): exports.append(quote('fp$' + str(k)) + ': ' + str(v)) return '{ ' + ', '.join(exports) + ' }' diff --git a/src/library.js b/src/library.js index 2eab15afc46eb..8ddab14617ae4 100644 --- a/src/library.js +++ b/src/library.js @@ -1865,7 +1865,7 @@ LibraryManager.library = { var result = lib.module[symbol]; if (typeof result === 'function') { #if WASM -#if EMULATED_FUNCTION_POINTERS +#if EMULATE_FUNCTION_POINTER_CASTS // for wasm with emulated function pointers, the i64 ABI is used for all // function calls, so we can't just call addFunction on something JS // can call (which does not use that ABI), as the function pointer would @@ -1881,7 +1881,7 @@ LibraryManager.library = { assert(typeof result === 'number', 'could not find function pointer for ' + symbol); #endif // ASSERTIONS return result; -#endif // EMULATED_FUNCTION_POINTERS +#endif // EMULATE_FUNCTION_POINTER_CASTS #endif // WASM // convert the exported function into a function pointer using our generic // JS mechanism. diff --git a/src/support.js b/src/support.js index 81cdec94c0767..a259b585f0cd7 100644 --- a/src/support.js +++ b/src/support.js @@ -229,14 +229,14 @@ function loadWebAssemblyModule(binary, loadAsync) { } if (typeof value === 'number') { // relocate it - modules export the absolute value, they can't relocate before they export -#if EMULATED_FUNCTION_POINTERS +#if EMULATE_FUNCTION_POINTER_CASTS // it may be a function pointer if (e.substr(0, 3) == 'fp$' && typeof instance.exports[e.substr(3)] === 'function') { value = value + env['tableBase']; } else { #endif value = value + env['memoryBase']; -#if EMULATED_FUNCTION_POINTERS +#if EMULATE_FUNCTION_POINTER_CASTS } #endif } diff --git a/tests/test_other.py b/tests/test_other.py index ae48a551d9275..f02cffb1279ba 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -8091,7 +8091,7 @@ def test(filename, expectations): 0, [], ['tempDoublePtr', 'waka'], 8, 0, 0), # totally empty! # but we don't metadce with linkable code! other modules may want it (['-O3', '-s', 'MAIN_MODULE=1'], - 1534, ['invoke_i'], ['waka'], 496958, 163, 2560), + 1534, ['invoke_i'], ['waka'], 469663, 163, 1449), ]) print('test on a minimal pure computational thing')