From 01714336189b4114865079bdc7bf834fec7ac9cc Mon Sep 17 00:00:00 2001 From: kichikuou Date: Sun, 9 Apr 2023 18:31:06 +0900 Subject: [PATCH] Update emscripten to 3.1.34 --- .github/workflows/emscripten.yml | 2 +- src/texthook.cpp | 18 +++++++++--------- src/texthook.h | 10 +++++++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 519eed7..fbfdf37 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -2,7 +2,7 @@ name: Emscripten Build on: [push, pull_request] env: - EM_VERSION: 3.1.32 + EM_VERSION: 3.1.34 EM_CACHE_FOLDER: 'emsdk-cache' jobs: diff --git a/src/texthook.cpp b/src/texthook.cpp index 5c3603f..e446f0f 100644 --- a/src/texthook.cpp +++ b/src/texthook.cpp @@ -9,17 +9,17 @@ void texthook_character(int page, int character) { character, page); } -void texthook_newline() { - EM_ASM(xsystem35.texthook.newline()); -} +EM_JS(void, texthook_newline, (void), { + xsystem35.texthook.newline(); +}); -void texthook_nextpage() { - EM_ASM(xsystem35.texthook.nextpage()); -} +EM_JS(void, texthook_nextpage, (void), { + xsystem35.texthook.nextpage(); +}); -void texthook_keywait(void) { - EM_ASM(xsystem35.texthook.keywait()); -} +EM_JS(void, texthook_keywait, (void), { + xsystem35.texthook.keywait(); +}); #elif defined(TEXTHOOK_PRINT) // -------------------------------------- diff --git a/src/texthook.h b/src/texthook.h index 4df418d..aba722f 100644 --- a/src/texthook.h +++ b/src/texthook.h @@ -1,9 +1,13 @@ #ifndef _TEXTHOOK_H_ #define _TEXTHOOK_H_ +extern "C" { + void texthook_character(int page, int character); -void texthook_newline(); -void texthook_nextpage(); -void texthook_keywait(); +void texthook_newline(void); +void texthook_nextpage(void); +void texthook_keywait(void); + +} #endif /* _TEXTHOOK_H_ */