register works
This commit is contained in:
@@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void {
|
||||
const release = b.option(bool, "release", "To build a wasm release") orelse false;
|
||||
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "math",
|
||||
.name = "zig",
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = target,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "niklas/zig/math",
|
||||
"id": "max/nodarium/zig",
|
||||
"outputs": [
|
||||
"float"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const std = @import("std");
|
||||
|
||||
const def linksection("nodarium_definition") = @embedFile("input.json");
|
||||
const def = @embedFile("input.json");
|
||||
|
||||
export fn execute(ptr: *anyopaque, len: c_int) c_int {
|
||||
_ = ptr; // autofix
|
||||
@@ -19,3 +19,11 @@ export fn __free(ptr: *anyopaque, len: c_int) void {
|
||||
const mem: [*]u8 = @ptrCast(@alignCast(ptr));
|
||||
std.heap.wasm_allocator.free(mem[0..@intCast(len)]);
|
||||
}
|
||||
|
||||
export fn getDefinitionPtr() *const anyopaque {
|
||||
return def.ptr;
|
||||
}
|
||||
|
||||
export fn getDefinitionLen() usize {
|
||||
return def.len;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user