diff --git a/xwords4/wasm/main.c b/xwords4/wasm/main.c index 4a1b94b0d..d84723297 100644 --- a/xwords4/wasm/main.c +++ b/xwords4/wasm/main.c @@ -517,10 +517,10 @@ looper( void* closure ) } void -button( const char* msg ) +button( void* closure, const char* msg ) { XP_Bool draw = XP_FALSE; - Globals* globals = sGlobals; + Globals* globals = (Globals*)closure; BoardCtxt* board = globals->game.board; XP_Bool redo; diff --git a/xwords4/wasm/shell_minimal.html b/xwords4/wasm/shell_minimal.html index 7fb953416..7d283bc90 100644 --- a/xwords4/wasm/shell_minimal.html +++ b/xwords4/wasm/shell_minimal.html @@ -195,7 +195,7 @@ } function callButton(name) { - Module.ccall('button', null, ['string'], [name]); + Module.ccall('button', null, ['number', 'string'], [state.closure, name]); } function onHaveDevID(closure, devid) {