Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions wasm/hello.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#include <stdio.h>
#include <stddef.h>
#include <emscripten/emscripten.h>

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;
}
Loading