From 57d8a0838bb29f69be52d9486e744a99caf77105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Matos?= Date: Tue, 30 Apr 2024 15:16:20 +0100 Subject: [PATCH] Fixes Emscripten wasm64 compile error in glcontext_html5.cpp. (#3282) Fixes compile error: ``` glcontext_html5.cpp:74:45: error: cast from pointer to smaller type 'EMSCRIPTEN_WEBGL_CONTEXT_HANDLE' (aka 'int') loses information 74 | EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = reinterpret_cast(g_platformData.context); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` --- src/glcontext_html5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glcontext_html5.cpp b/src/glcontext_html5.cpp index 430c870e0..6e89f4876 100644 --- a/src/glcontext_html5.cpp +++ b/src/glcontext_html5.cpp @@ -71,7 +71,7 @@ namespace bgfx { namespace gl const char* canvas = (const char*) g_platformData.nwh; - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = (EMSCRIPTEN_WEBGL_CONTEXT_HANDLE) g_platformData.context; + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = bx::narrowCast((uintptr_t) g_platformData.context); if (context > 0) { if (emscripten_webgl_get_context_attributes(context, &s_attrs) >= 0)