Skip to content

Commit

Permalink
Export ccall, malloc and fileRead
Browse files Browse the repository at this point in the history
  • Loading branch information
bwrsandman committed Aug 4, 2023
1 parent df8c2f3 commit 10694fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (EMSCRIPTEN)
LINK_FLAGS_DEBUG "-g3 -gsource-map"
COMPILE_FLAGS "-s USE_SDL=2 -fexceptions"
LINK_FLAGS
"-s ALLOW_MEMORY_GROWTH=1 -s USE_SDL=2 -s FULL_ES3=1 -s GL_ASSERTIONS=1 -s USE_WEBGL2=1 -fexceptions --emrun"
"-s EXPORTED_FUNCTIONS=\"['_main', '_malloc']\" -s EXPORTED_RUNTIME_METHODS=ccall -s ALLOW_MEMORY_GROWTH=1 -s USE_SDL=2 -s FULL_ES3=1 -s GL_ASSERTIONS=1 -s USE_WEBGL2=1 -fexceptions --emrun"
SUFFIX ".html"
)
endif ()
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ EM_JS(void, jsOpenDialog, (), {
var data = Module._malloc(length);

Module.HEAPU8.set(contents, data);
Module.asm.fileRead(data, length);
Module.ccall('fileRead', null, ['number', 'number'], [data, length]);

Module._free(data);
};
Expand Down

0 comments on commit 10694fd

Please sign in to comment.