diff --git a/Makefile b/Makefile index a0e9349..c12bb06 100644 --- a/Makefile +++ b/Makefile @@ -221,6 +221,9 @@ EXPORTED_SHE=$(shell cat $(SHE_TXT)) docs/demo/mclshe.js: src/fp.cpp src/she_c256.cpp $(SHE_TXT) $(EXPORTED_SHE_JS) src/she_c_impl.hpp include/mcl/she.hpp emcc -o $@ src/fp.cpp src/she_c256.cpp -I./include -I./src -I../cybozulib/include -s WASM=1 -s "MODULARIZE=1" -s "EXPORTED_FUNCTIONS=[$(EXPORTED_SHE)]" -O3 -DNDEBUG -DMCLBN_FP_UNIT_SIZE=4 -DMCL_MAX_BIT_SIZE=256 -s DISABLE_EXCEPTION_CATCHING=0 -s NO_EXIT_RUNTIME=1 -DMCLSHE_WIN_SIZE=8 +../she-wasm/she.js: src/fp.cpp src/she_c256.cpp src/she_c_impl.hpp include/mcl/she.hpp include/mcl/she.h include/mcl/bn.h + cd ../she-wasm && emcc -O3 -DNDEBUG -DMCLBN_FP_UNIT_SIZE=4 -DMCL_MAX_BIT_SIZE=256 -s WASM=1 -s DISABLE_EXCEPTION_CATCHING=0 -s NO_EXIT_RUNTIME=1 -DMCLSHE_WIN_SIZE=8 -o she.js ../mcl/src/fp.cpp ../mcl/src/she_c256.cpp -I../mcl/include -I../mcl/src -I../cybozulib/include + demo: $(MAKE) docs/demo/mclshe.js diff --git a/include/mcl/bn.h b/include/mcl/bn.h index d8da9e1..f57aa34 100644 --- a/include/mcl/bn.h +++ b/include/mcl/bn.h @@ -29,7 +29,11 @@ #endif #endif #else -#define MCLBN_DLL_API +#ifdef __EMSCRIPTEN__ + #define MCLBN_DLL_API __attribute__((used)) +#else + #define MCLBN_DLL_API +#endif #endif #ifdef __cplusplus diff --git a/include/mcl/she.h b/include/mcl/she.h index 6fe6d68..093c7a0 100644 --- a/include/mcl/she.h +++ b/include/mcl/she.h @@ -24,7 +24,11 @@ #endif #endif #else -#define MCLSHE_DLL_API +#ifdef __EMSCRIPTEN__ + #define MCLSHE_DLL_API __attribute__((used)) +#else + #define MCLSHE_DLL_API +#endif #endif #ifdef __cplusplus