[js] use __attribute__((used)) instead of EXPORTED_FUNCTIONS

dev
MITSUNARI Shigeo 7 years ago
parent 4941c28cd3
commit 03925e780a
  1. 3
      Makefile
  2. 6
      include/mcl/bn.h
  3. 6
      include/mcl/she.h

@ -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 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 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: demo:
$(MAKE) docs/demo/mclshe.js $(MAKE) docs/demo/mclshe.js

@ -29,7 +29,11 @@
#endif #endif
#endif #endif
#else #else
#define MCLBN_DLL_API #ifdef __EMSCRIPTEN__
#define MCLBN_DLL_API __attribute__((used))
#else
#define MCLBN_DLL_API
#endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

@ -24,7 +24,11 @@
#endif #endif
#endif #endif
#else #else
#define MCLSHE_DLL_API #ifdef __EMSCRIPTEN__
#define MCLSHE_DLL_API __attribute__((used))
#else
#define MCLSHE_DLL_API
#endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

Loading…
Cancel
Save