diff options
-rw-r--r-- | src/jsifier.js | 6 | ||||
-rw-r--r-- | tests/test_other.py | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 503f0b71..065c66a8 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -397,8 +397,10 @@ function JSify(data, functionsOnly) { if (!LibraryManager.library.hasOwnProperty(ident) && !LibraryManager.library.hasOwnProperty(ident + '__inline')) { if (notDep) { - if (ERROR_ON_UNDEFINED_SYMBOLS) error('unresolved symbol: ' + ident); - else if (VERBOSE || (WARN_ON_UNDEFINED_SYMBOLS && !LINKABLE)) warn('unresolved symbol: ' + ident); + if (VERBOSE || ident.substr(0, 11) !== 'emscripten_') { // avoid warning on emscripten_* functions which are for internal usage anyhow + if (ERROR_ON_UNDEFINED_SYMBOLS) error('unresolved symbol: ' + ident); + else if (VERBOSE || (WARN_ON_UNDEFINED_SYMBOLS && !LINKABLE)) warn('unresolved symbol: ' + ident); + } } // emit a stub that will fail at runtime LibraryManager.library[shortident] = new Function("Module['printErr']('missing function: " + shortident + "'); abort(-1);"); diff --git a/tests/test_other.py b/tests/test_other.py index ded45112..f9b0009d 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -1586,6 +1586,8 @@ This pointer might make sense in another type signature: i: 0 def test_warn_undefined(self): open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r''' #include <stdio.h> + #include <SDL.h> + #include "SDL/SDL_opengl.h" extern "C" { void something(); @@ -1593,6 +1595,7 @@ This pointer might make sense in another type signature: i: 0 } int main() { + printf("%p", SDL_GL_GetProcAddress("glGenTextures")); // pull in gl proc stuff, avoid warnings on emulation funcs something(); elsey(); return 0; @@ -1612,6 +1615,7 @@ This pointer might make sense in another type signature: i: 0 self.assertContained('unresolved symbol: something', output[1]) self.assertContained('unresolved symbol: elsey', output[1]) assert os.path.exists('a.out.js') + self.assertNotContained('unresolved symbol: emscripten_', output[1]) elif action == 'ERROR' and value: self.assertContained('unresolved symbol: something', output[1]) self.assertContained('unresolved symbol: elsey', output[1]) |