WebAssembly / wasm-c-api

Wasm C API prototype
Apache License 2.0
550 stars 77 forks source link

Add WASI_API macro to each API entry point #112

Closed sbc100 closed 5 years ago

sbc100 commented 5 years ago

This allows the build system do think such as: -DWASM_API=attribute((visibility("default")))

An alternative to this would be do something more explicit and include the macros in the source like in binaryen:

if defined(_MSC_VER) && !defined(BUILD_STATIC_LIBRARY)

efine BINARYEN_API __declspec(dllexport)

else

Or we could try to do it without tagging each entry point using:

pragma GCC visibility push

pragma GCC visibility pop

But these is less portable. For example I'm not sure if msvc supports this kind of things.

rossberg commented 5 years ago

Isn't this a duplicate of #77?

sbc100 commented 5 years ago

Yup! Total duplicate.