From 44152f6c369c68850a23f73f57ebb34c904f2a04 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 26 Jun 2021 17:00:40 -0700 Subject: [PATCH] fix wasm build a bit Still doesn't seem to work on new install --- xwords4/wasm/Makefile | 3 ++- xwords4/wasm/wasmdutil.c | 12 +++++++++++- xwords4/wasm/wasmutil.c | 3 +-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/xwords4/wasm/Makefile b/xwords4/wasm/Makefile index 864d4ee35..4ca6cf1d7 100644 --- a/xwords4/wasm/Makefile +++ b/xwords4/wasm/Makefile @@ -64,7 +64,7 @@ DEFINES += -DROOT_PATH=\"$(ROOT_PATH)\" OUTPUTS = main.html main.js main.js.mem main.data main.html.mem main.wasm -all: main.js +all: main.html # PHONY: install @@ -89,6 +89,7 @@ main.html: ${INPUTS} Makefile shell_minimal.html install: main.html if [ -n "${XW_WASM_DEST}" ]; then \ for FILE in ${OUTPUTS} paho-mqtt.js xwutils.js; do \ + mkdir -p ${XW_WASM_DEST}/${WEBDIR}; \ [ -f $$FILE ] && scp $$FILE ${XW_WASM_DEST}/${WEBDIR}/; \ echo "$$FILE copied"; \ done; \ diff --git a/xwords4/wasm/wasmdutil.c b/xwords4/wasm/wasmdutil.c index 46e852592..b0716b92e 100644 --- a/xwords4/wasm/wasmdutil.c +++ b/xwords4/wasm/wasmdutil.c @@ -425,6 +425,15 @@ wasm_dutil_onGameGoneReceived( XW_DUtilCtxt* duc, XWEnv XP_UNUSED(xwe), main_onGameGone( globals, gameID ); } + +static void +wasm_dutil_ackMQTTMsg( XW_DUtilCtxt* duc, XWEnv xwe, XP_U32 gameID, + const MQTTDevID* senderID, const XP_U8* msg, + XP_U16 len ) +{ + XP_ASSERT(0); /* implement me */ +} + static void onSynced(void* closure, const char* str) { @@ -487,10 +496,11 @@ wasm_dutil_make( MPFORMAL VTableMgr* vtMgr, void* closure ) SET_PROC(onInviteReceived); SET_PROC(onMessageReceived); SET_PROC(onGameGoneReceived); + SET_PROC(ackMQTTMsg); # undef SET_PROC - assertTableFull( &result->super.vtable, sizeof(result->super.vtable), "wasmutil" ); + assertTableFull( &result->super.vtable, sizeof(result->super.vtable), "wasmdutil" ); LOG_RETURNF( "%p", &result->super ); return &result->super; diff --git a/xwords4/wasm/wasmutil.c b/xwords4/wasm/wasmutil.c index c7004d543..497953b9e 100644 --- a/xwords4/wasm/wasmutil.c +++ b/xwords4/wasm/wasmutil.c @@ -637,6 +637,7 @@ wasm_util_make( MPFORMAL CurGameInfo* gi, XW_DUtilCtxt* dctxt, GameState* closur SET_VTABLE_ENTRY( wuctxt->super.vtable, util_informMove, wasm ); SET_VTABLE_ENTRY( wuctxt->super.vtable, util_informUndo, wasm ); SET_VTABLE_ENTRY( wuctxt->super.vtable, util_informNetDict, wasm ); + SET_VTABLE_ENTRY( wuctxt->super.vtable, util_getDict, wasm ); SET_VTABLE_ENTRY( wuctxt->super.vtable, util_notifyGameOver, wasm ); SET_VTABLE_ENTRY( wuctxt->super.vtable, util_engineProgressCallback, wasm ); #ifdef XWFEATURE_HILITECELL @@ -655,8 +656,6 @@ wasm_util_make( MPFORMAL CurGameInfo* gi, XW_DUtilCtxt* dctxt, GameState* closur SET_VTABLE_ENTRY( wuctxt->super.vtable, util_bonusSquareHeld, wasm ); SET_VTABLE_ENTRY( wuctxt->super.vtable, util_playerScoreHeld, wasm ); - SET_VTABLE_ENTRY( wuctxt->super.vtable, util_getDict, wasm ); - #ifdef XWFEATURE_BOARDWORDS SET_VTABLE_ENTRY( wuctxt->super.vtable, util_cellSquareHeld, wasm ); #endif