aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/api/ffi.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bun.js/api/ffi.zig b/src/bun.js/api/ffi.zig
index 0fe736258..dd5de1da7 100644
--- a/src/bun.js/api/ffi.zig
+++ b/src/bun.js/api/ffi.zig
@@ -522,9 +522,9 @@ pub const FFI = struct {
}
if (val.isAnyInt()) {
- const int = val.toInt32();
+ const int = val.to(i32);
switch (int) {
- 0...14 => {
+ 0...ABIType.max => {
abi_types.appendAssumeCapacity(@intToEnum(ABIType, int));
continue;
},
@@ -561,7 +561,7 @@ pub const FFI = struct {
if (ret_value.isAnyInt()) {
const int = ret_value.toInt32();
switch (int) {
- 0...14 => {
+ 0...ABIType.max => {
return_type = @intToEnum(ABIType, int);
break :brk;
},
@@ -1330,6 +1330,8 @@ pub const FFI = struct {
function = 17,
+ pub const max = @enumToInt(ABIType.function);
+
/// Types that we can directly pass through as an `int64_t`
pub fn needsACastInC(this: ABIType) bool {
return switch (this) {