Got a basic WebAssembly module compiling with support for calling jsStdPrint through printf implementation (provided by stb_sprintf.h). We have a single function "HelloFromWasm" exported for testing purposes. Pulled in a bunch of standard library headers from PigCore's wasm layer.
This commit is contained in:
17
cwasm.c
Normal file
17
cwasm.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
File: main.c
|
||||
Author: Taylor Robbins
|
||||
Date: 08\28\2025
|
||||
Description:
|
||||
** This file serves as the compilable file for all of CWasm. It may be #included by the app.c file
|
||||
*/
|
||||
|
||||
#include "cwasm.h"
|
||||
|
||||
#include "std/src/std_main.c"
|
||||
|
||||
WASM_EXPORT(HelloFromWasm) int HelloFromWasm(int value)
|
||||
{
|
||||
printf("Called HelloFromWasm(%d)!\n", value);
|
||||
return value*(value+1)*2;
|
||||
}
|
||||
Reference in New Issue
Block a user