Added needed changed for normal compiling with emscripten 1.38.41 and later (cherry picked from commit 3c176827d6)
3c176827d6