diff --git a/wasm/hello.c b/wasm/hello.c index f3b4f7b..bd79652 100644 --- a/wasm/hello.c +++ b/wasm/hello.c @@ -1,7 +1,16 @@ -#include +#include +#include -int main(void) +static const char GREETING[] = "Hello from WebAssembly!"; + +EMSCRIPTEN_KEEPALIVE +const char *get_greeting(void) +{ + return GREETING; +} + +EMSCRIPTEN_KEEPALIVE +size_t get_greeting_length(void) { - printf("Hello, world!\n"); - return 0; + return sizeof(GREETING) - 1; }