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_ */