From b8794585e42afebd03e673f3032fee4a0d2f40a3 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 25 Jun 2020 23:45:56 +1000 Subject: [PATCH] Fix web client not compiling on really old emscripten versions such as 1.38.21 --- src/Window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Window.c b/src/Window.c index 631642c70..8875dbb1f 100644 --- a/src/Window.c +++ b/src/Window.c @@ -3256,6 +3256,12 @@ static EM_BOOL OnKeyPress(int type, const EmscriptenKeyboardEvent* ev, void* dat return true; } +/* Really old emscripten versions (e.g. 1.38.21) don't have this defined */ +/* Can't just use "#window", newer versions switched to const int instead */ +#ifndef EMSCRIPTEN_EVENT_TARGET_WINDOW +#define EMSCRIPTEN_EVENT_TARGET_WINDOW "#window" +#endif + static void HookEvents(void) { emscripten_set_wheel_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, NULL, 0, OnMouseWheel); emscripten_set_mousedown_callback("#canvas", NULL, 0, OnMouseButton);