diff --git a/sokol_app.h b/sokol_app.h index e0c3462bd..4b1c6e520 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -4751,7 +4751,7 @@ _SOKOL_PRIVATE void _sapp_ios_show_keyboard(bool shown) { #if defined(_SAPP_EMSCRIPTEN) #if defined(EM_JS_DEPS) -EM_JS_DEPS(sokol_app, "$withStackSave,$allocateUTF8OnStack"); +EM_JS_DEPS(sokol_app, "$withStackSave,$stringToUTF8OnStack"); #endif #ifdef __cplusplus @@ -4868,7 +4868,7 @@ EM_JS(void, sapp_js_add_clipboard_listener, (void), { Module.sokol_paste = (event) => { const pasted_str = event.clipboardData.getData('text'); withStackSave(() => { - const cstr = allocateUTF8OnStack(pasted_str); + const cstr = stringToUTF8OnStack(pasted_str); __sapp_emsc_onpaste(cstr); }); }; @@ -4925,7 +4925,7 @@ EM_JS(void, sapp_js_add_dragndrop_listeners, (const char* canvas_name_cstr), { __sapp_emsc_begin_drop(files.length); for (let i = 0; i < files.length; i++) { withStackSave(() => { - const cstr = allocateUTF8OnStack(files[i].name); + const cstr = stringToUTF8OnStack(files[i].name); __sapp_emsc_drop(i, cstr); }); } diff --git a/sokol_args.h b/sokol_args.h index 6c560baea..b5b4d47ca 100644 --- a/sokol_args.h +++ b/sokol_args.h @@ -695,7 +695,7 @@ extern "C" { #endif #if defined(EM_JS_DEPS) -EM_JS_DEPS(sokol_audio, "$withStackSave,$allocateUTF8OnStack"); +EM_JS_DEPS(sokol_audio, "$withStackSave,$stringToUTF8OnStack"); #endif EMSCRIPTEN_KEEPALIVE void _sargs_add_kvp(const char* key, const char* val) { @@ -734,8 +734,8 @@ EM_JS(void, sargs_js_parse_url, (void), { const key = p.value[0]; const val = p.value[1]; withStackSave(() => { - const key_cstr = allocateUTF8OnStack(key); - const val_cstr = allocateUTF8OnStack(val); + const key_cstr = stringToUTF8OnStack(key); + const val_cstr = stringToUTF8OnStack(val); __sargs_add_kvp(key_cstr, val_cstr) }); }