diff options
author | 2022-07-05 00:55:07 -0700 | |
---|---|---|
committer | 2022-07-05 00:55:07 -0700 | |
commit | 288178e94c7ca93f026c70f0b0cd4fb32c63e98f (patch) | |
tree | c83320e2e3abc2b9649063068c83e47f82339454 | |
parent | ebb4f85feb4c2d064cc7a9aea94c9d8a949f4fd5 (diff) | |
download | bun-288178e94c7ca93f026c70f0b0cd4fb32c63e98f.tar.gz bun-288178e94c7ca93f026c70f0b0cd4fb32c63e98f.tar.zst bun-288178e94c7ca93f026c70f0b0cd4fb32c63e98f.zip |
Fix bug in ffi
-rw-r--r-- | src/bun.js/api/FFI.h | 2 | ||||
-rw-r--r-- | src/bun.js/api/ffi.zig | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/bun.js/api/FFI.h b/src/bun.js/api/FFI.h index fb8f4710f..b0a754a01 100644 --- a/src/bun.js/api/FFI.h +++ b/src/bun.js/api/FFI.h @@ -13,7 +13,7 @@ #define USE_JSVALUE64 1 #define USE_JSVALUE32_64 0 -#define ZIG_REPR_TYPE uint64_t +#define ZIG_REPR_TYPE int64_t // /* 7.18.1.1 Exact-width integer types */ diff --git a/src/bun.js/api/ffi.zig b/src/bun.js/api/ffi.zig index b4db32e4a..45e117537 100644 --- a/src/bun.js/api/ffi.zig +++ b/src/bun.js/api/ffi.zig @@ -989,7 +989,7 @@ pub const FFI = struct { \\ \\ \\/* ---- Your Wrapper Function ---- */ - \\void* JSFunctionCall(void* globalObject, void* callFrame) { + \\ZIG_REPR_TYPE JSFunctionCall(void* globalObject, void* callFrame) { \\ ); @@ -1085,9 +1085,9 @@ pub const FFI = struct { try writer.writeAll("return "); if (!(this.return_type == .void)) { - try writer.print("{}.asPtr", .{this.return_type.toJS("return_value")}); + try writer.print("{}.asZigRepr", .{this.return_type.toJS("return_value")}); } else { - try writer.writeAll("ValueUndefined.asPtr"); + try writer.writeAll("ValueUndefined.asZigRepr"); } try writer.writeAll(";\n}\n\n"); |