#include "onyxparser.h"
-typedef enum WasmType : char {
- WASM_TYPE_INT32 = 0x7F,
- WASM_TYPE_INT64 = 0x7E,
- WASM_TYPE_FLOAT32 = 0x7D,
- WASM_TYPE_FLOAT64 = 0x7C
-} WasmType;
+typedef char WasmType;
+
+extern const WasmType WASM_TYPE_INT32;
+extern const WasmType WASM_TYPE_INT64;
+extern const WasmType WASM_TYPE_FLOAT32;
+extern const WasmType WASM_TYPE_FLOAT64;
typedef struct WasmFuncType {
// NOTE: For now, WASM only allows for 1 return value.
#include "onyxwasm.h"
+const WasmType WASM_TYPE_INT32 = 0x7F;
+const WasmType WASM_TYPE_INT64 = 0x7E;
+const WasmType WASM_TYPE_FLOAT32 = 0x7D;
+const WasmType WASM_TYPE_FLOAT64 = 0x7C;
+
static WasmType onyx_type_to_wasm_type(OnyxTypeInfo* type) {
if (type->is_bool) return WASM_TYPE_INT32;
if (type->is_int) {
}
void onyx_wasm_module_free(OnyxWasmModule* module) {
- bh_arr_free(module.functypes);
- bh_arr_free(module.funcs);
+ bh_arr_free(module->functypes);
+ bh_arr_free(module->funcs);
}