-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Hallo,
Today i tried to switch to new emsdk 3.1.63 and cannot compile my code anymore...
it throws errors:
C:/Projects/TMRW/RoomGit/tmrwNative/Tmrw/src/Tmrw/Platform/EmscriptenApplication.cpp:443:9: error: no matching function for call to 'emscripten_set_resize_callback_on_thread'
443 | emscripten_set_resize_callback(target, this, false, cb);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Projects\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/html5.h:442:95: note: expanded from macro 'emscripten_set_resize_callback'
442 | #define emscripten_set_resize_callback(target, userData, useCapture, callback) emscripten_set_resize_callback_on_thread( (target), (userData), (useCapture), (callback), EM_CALLBACK_THREAD_CONTEXT_CALLING_THREAD)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Projects\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/html5.h:177:19: note: candidate function not viable: no known conversion from '(lambda at C:\Projects\TMRW\RoomGit\tmrwNative\Tmrw\src\Tmrw\Platform\EmscriptenApplication.cpp:438:19)' to 'em_ui_callback_func' (aka 'bool (*)(int, const EmscriptenUiEvent *, void *)') for 4th argument
177 | EMSCRIPTEN_RESULT emscripten_set_resize_callback_on_thread(const char *target attribute((nonnull)), void *userData, EM_BOOL useCapture, em_ui_callback_func callback, pthread_t targetThread);
The code looks like this:
const char* target = EMSCRIPTEN_EVENT_TARGET_WINDOW;
auto cb = [](int, const EmscriptenUiEvent* event, void* userData) -> TInt
{
static_cast<EmscriptenApplication*>(userData)->handleCanvasResize(event);
return false;
};
emscripten_set_resize_callback(target, this, false, cb);
How to fix this?
I checked release notes but there are no any notes about those changes!