We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc35806 commit 9832932Copy full SHA for 9832932
1 file changed
wasm/hello.c
@@ -1,7 +1,16 @@
1
-#include <stdio.h>
+#include <stddef.h>
2
+#include <emscripten/emscripten.h>
3
-int main(void)
4
+static const char GREETING[] = "Hello from WebAssembly!";
5
+
6
+EMSCRIPTEN_KEEPALIVE
7
+const char *get_greeting(void)
8
+{
9
+ return GREETING;
10
+}
11
12
13
+size_t get_greeting_length(void)
14
{
- printf("Hello, world!\n");
- return 0;
15
+ return sizeof(GREETING) - 1;
16
}
0 commit comments