Skip to content

Commit

Permalink
Fix formatting for extern "c" (#16983)
Browse files Browse the repository at this point in the history
  • Loading branch information
fel1x-developer authored Feb 3, 2025
1 parent 06b16fc commit fa50250
Show file tree
Hide file tree
Showing 24 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .cursor/rules/javascriptcore-class.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ extern "C" JSC::EncodedJSValue Bun__JSBigIntStatsObjectConstructor(Zig::GlobalOb

Zig:
```zig
extern "C" fn Bun__JSBigIntStatsObjectConstructor(*JSC.JSGlobalObject) JSC.JSValue;
extern "c" fn Bun__JSBigIntStatsObjectConstructor(*JSC.JSGlobalObject) JSC.JSValue;
pub const getBigIntStatsConstructor = Bun__JSBigIntStatsObjectConstructor;
```

Expand Down
2 changes: 1 addition & 1 deletion src/bun.js/api/Timer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ pub const TimerObject = struct {
pub usingnamespace JSC.Codegen.JSTimeout;
pub usingnamespace bun.NewRefCounted(@This(), deinit, null);

extern "C" fn Bun__JSTimeout__call(encodedTimeoutValue: JSValue, globalObject: *JSC.JSGlobalObject) void;
extern "c" fn Bun__JSTimeout__call(encodedTimeoutValue: JSValue, globalObject: *JSC.JSGlobalObject) void;

pub fn runImmediateTask(this: *TimerObject, vm: *VirtualMachine) void {
if (this.has_cleared_timer) {
Expand Down
8 changes: 4 additions & 4 deletions src/bun.js/api/bun/process.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2042,16 +2042,16 @@ pub const sync = struct {
}

// Forward signals from parent to the child process.
extern "C" fn Bun__registerSignalsForForwarding() void;
extern "C" fn Bun__unregisterSignalsForForwarding() void;
extern "c" fn Bun__registerSignalsForForwarding() void;
extern "c" fn Bun__unregisterSignalsForForwarding() void;

// The PID to forward signals to.
// Set to 0 when unregistering.
extern "C" var Bun__currentSyncPID: i64;
extern "c" var Bun__currentSyncPID: i64;

// Race condition: a signal could be sent before spawnProcessPosix returns.
// We need to make sure to send it after the process is spawned.
extern "C" fn Bun__sendPendingSignalIfNecessary() void;
extern "c" fn Bun__sendPendingSignalIfNecessary() void;

fn spawnPosix(
options: *const Options,
Expand Down
48 changes: 24 additions & 24 deletions src/bun.js/api/ffi.zig
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const Offsets = extern struct {
JSArrayBufferView__offsetOfVector: u32,
JSCell__offsetOfType: u32,

extern "C" var Bun__FFI__offsets: Offsets;
extern "C" fn Bun__FFI__ensureOffsetsAreLoaded() void;
extern "c" var Bun__FFI__offsets: Offsets;
extern "c" fn Bun__FFI__ensureOffsetsAreLoaded() void;
fn loadOnce() void {
Bun__FFI__ensureOffsetsAreLoaded();
}
Expand Down Expand Up @@ -165,27 +165,27 @@ pub const FFI = struct {
};

const stdarg = struct {
extern "C" fn ffi_vfprintf(*anyopaque, [*:0]const u8, ...) callconv(.C) c_int;
extern "C" fn ffi_vprintf([*:0]const u8, ...) callconv(.C) c_int;
extern "C" fn ffi_fprintf(*anyopaque, [*:0]const u8, ...) callconv(.C) c_int;
extern "C" fn ffi_printf([*:0]const u8, ...) callconv(.C) c_int;
extern "C" fn ffi_fscanf(*anyopaque, [*:0]const u8, ...) callconv(.C) c_int;
extern "C" fn ffi_scanf([*:0]const u8, ...) callconv(.C) c_int;
extern "C" fn ffi_sscanf([*:0]const u8, [*:0]const u8, ...) callconv(.C) c_int;
extern "C" fn ffi_vsscanf([*:0]const u8, [*:0]const u8, ...) callconv(.C) c_int;
extern "C" fn ffi_fopen([*:0]const u8, [*:0]const u8) callconv(.C) *anyopaque;
extern "C" fn ffi_fclose(*anyopaque) callconv(.C) c_int;
extern "C" fn ffi_fgetc(*anyopaque) callconv(.C) c_int;
extern "C" fn ffi_fputc(c: c_int, *anyopaque) callconv(.C) c_int;
extern "C" fn ffi_feof(*anyopaque) callconv(.C) c_int;
extern "C" fn ffi_fileno(*anyopaque) callconv(.C) c_int;
extern "C" fn ffi_ungetc(c: c_int, *anyopaque) callconv(.C) c_int;
extern "C" fn ffi_ftell(*anyopaque) callconv(.C) c_long;
extern "C" fn ffi_fseek(*anyopaque, c_long, c_int) callconv(.C) c_int;
extern "C" fn ffi_fflush(*anyopaque) callconv(.C) c_int;

extern "C" fn calloc(nmemb: usize, size: usize) callconv(.C) ?*anyopaque;
extern "C" fn perror([*:0]const u8) callconv(.C) void;
extern "c" fn ffi_vfprintf(*anyopaque, [*:0]const u8, ...) callconv(.C) c_int;
extern "c" fn ffi_vprintf([*:0]const u8, ...) callconv(.C) c_int;
extern "c" fn ffi_fprintf(*anyopaque, [*:0]const u8, ...) callconv(.C) c_int;
extern "c" fn ffi_printf([*:0]const u8, ...) callconv(.C) c_int;
extern "c" fn ffi_fscanf(*anyopaque, [*:0]const u8, ...) callconv(.C) c_int;
extern "c" fn ffi_scanf([*:0]const u8, ...) callconv(.C) c_int;
extern "c" fn ffi_sscanf([*:0]const u8, [*:0]const u8, ...) callconv(.C) c_int;
extern "c" fn ffi_vsscanf([*:0]const u8, [*:0]const u8, ...) callconv(.C) c_int;
extern "c" fn ffi_fopen([*:0]const u8, [*:0]const u8) callconv(.C) *anyopaque;
extern "c" fn ffi_fclose(*anyopaque) callconv(.C) c_int;
extern "c" fn ffi_fgetc(*anyopaque) callconv(.C) c_int;
extern "c" fn ffi_fputc(c: c_int, *anyopaque) callconv(.C) c_int;
extern "c" fn ffi_feof(*anyopaque) callconv(.C) c_int;
extern "c" fn ffi_fileno(*anyopaque) callconv(.C) c_int;
extern "c" fn ffi_ungetc(c: c_int, *anyopaque) callconv(.C) c_int;
extern "c" fn ffi_ftell(*anyopaque) callconv(.C) c_long;
extern "c" fn ffi_fseek(*anyopaque, c_long, c_int) callconv(.C) c_int;
extern "c" fn ffi_fflush(*anyopaque) callconv(.C) c_int;

extern "c" fn calloc(nmemb: usize, size: usize) callconv(.C) ?*anyopaque;
extern "c" fn perror([*:0]const u8) callconv(.C) void;

const mac = if (Environment.isMac) struct {
var ffi_stdinp: *anyopaque = @extern(*anyopaque, .{ .name = "__stdinp" });
Expand Down Expand Up @@ -1471,7 +1471,7 @@ pub const FFI = struct {
return val.return_type == ABIType.napi_value;
}

extern "C" fn FFICallbackFunctionWrapper_destroy(*anyopaque) void;
extern "c" fn FFICallbackFunctionWrapper_destroy(*anyopaque) void;

pub fn deinit(val: *Function, globalThis: *JSC.JSGlobalObject, allocator: std.mem.Allocator) void {
JSC.markBinding(@src());
Expand Down
8 changes: 4 additions & 4 deletions src/bun.js/base.zig
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ pub const ArrayBuffer = extern struct {
return Bun__createUint8ArrayForCopy(globalThis, bytes.ptr, bytes.len, false);
}

extern "C" fn Bun__allocUint8ArrayForCopy(*JSC.JSGlobalObject, usize, **anyopaque) JSC.JSValue;
extern "c" fn Bun__allocUint8ArrayForCopy(*JSC.JSGlobalObject, usize, **anyopaque) JSC.JSValue;
pub fn allocBuffer(globalThis: *JSC.JSGlobalObject, len: usize) struct { JSC.JSValue, []u8 } {
var ptr: [*]u8 = undefined;
const buffer = Bun__allocUint8ArrayForCopy(globalThis, len, @ptrCast(&ptr));
Expand All @@ -418,8 +418,8 @@ pub const ArrayBuffer = extern struct {
return .{ buffer, ptr[0..len] };
}

extern "C" fn Bun__createUint8ArrayForCopy(*JSC.JSGlobalObject, ptr: ?*const anyopaque, len: usize, buffer: bool) JSC.JSValue;
extern "C" fn Bun__createArrayBufferForCopy(*JSC.JSGlobalObject, ptr: ?*const anyopaque, len: usize) JSC.JSValue;
extern "c" fn Bun__createUint8ArrayForCopy(*JSC.JSGlobalObject, ptr: ?*const anyopaque, len: usize, buffer: bool) JSC.JSValue;
extern "c" fn Bun__createArrayBufferForCopy(*JSC.JSGlobalObject, ptr: ?*const anyopaque, len: usize) JSC.JSValue;

pub fn fromTypedArray(ctx: JSC.C.JSContextRef, value: JSC.JSValue) ArrayBuffer {
var out = std.mem.zeroes(ArrayBuffer);
Expand All @@ -429,7 +429,7 @@ pub const ArrayBuffer = extern struct {
return out;
}

extern "C" fn JSArrayBuffer__fromDefaultAllocator(*JSC.JSGlobalObject, ptr: [*]u8, len: usize) JSC.JSValue;
extern "c" fn JSArrayBuffer__fromDefaultAllocator(*JSC.JSGlobalObject, ptr: [*]u8, len: usize) JSC.JSValue;
pub fn toJSFromDefaultAllocator(globalThis: *JSC.JSGlobalObject, bytes: []u8) JSC.JSValue {
return JSArrayBuffer__fromDefaultAllocator(globalThis, bytes.ptr, bytes.len);
}
Expand Down
2 changes: 1 addition & 1 deletion src/bun.js/bindings/CPUFeatures.zig
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ else
}
};

extern "C" fn bun_cpu_features() u8;
extern "c" fn bun_cpu_features() u8;

const assert = bun.debugAssert;
12 changes: 6 additions & 6 deletions src/bun.js/bindings/JSPropertyIterator.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const bun = @import("root").bun;
const JSC = bun.JSC;

//extern "C" EncodedJSValue Bun__JSPropertyIterator__getNameAndValue(JSPropertyIterator* iter, JSC::JSGlobalObject* globalObject, JSC::JSObject* object, BunString* propertyName, size_t i)
extern "C" fn Bun__JSPropertyIterator__create(globalObject: *JSC.JSGlobalObject, encodedValue: JSC.JSValue, *usize, own_properties_only: bool, only_non_index_properties: bool) ?*anyopaque;
extern "C" fn Bun__JSPropertyIterator__getNameAndValue(iter: ?*anyopaque, globalObject: *JSC.JSGlobalObject, object: *anyopaque, propertyName: *bun.String, i: usize) JSC.JSValue;
extern "C" fn Bun__JSPropertyIterator__getNameAndValueNonObservable(iter: ?*anyopaque, globalObject: *JSC.JSGlobalObject, object: *anyopaque, propertyName: *bun.String, i: usize) JSC.JSValue;
extern "C" fn Bun__JSPropertyIterator__getName(iter: ?*anyopaque, propertyName: *bun.String, i: usize) void;
extern "C" fn Bun__JSPropertyIterator__deinit(iter: ?*anyopaque) void;
extern "C" fn Bun__JSPropertyIterator__getLongestPropertyName(iter: ?*anyopaque, globalObject: *JSC.JSGlobalObject, object: *anyopaque) usize;
extern "c" fn Bun__JSPropertyIterator__create(globalObject: *JSC.JSGlobalObject, encodedValue: JSC.JSValue, *usize, own_properties_only: bool, only_non_index_properties: bool) ?*anyopaque;
extern "c" fn Bun__JSPropertyIterator__getNameAndValue(iter: ?*anyopaque, globalObject: *JSC.JSGlobalObject, object: *anyopaque, propertyName: *bun.String, i: usize) JSC.JSValue;
extern "c" fn Bun__JSPropertyIterator__getNameAndValueNonObservable(iter: ?*anyopaque, globalObject: *JSC.JSGlobalObject, object: *anyopaque, propertyName: *bun.String, i: usize) JSC.JSValue;
extern "c" fn Bun__JSPropertyIterator__getName(iter: ?*anyopaque, propertyName: *bun.String, i: usize) void;
extern "c" fn Bun__JSPropertyIterator__deinit(iter: ?*anyopaque) void;
extern "c" fn Bun__JSPropertyIterator__getLongestPropertyName(iter: ?*anyopaque, globalObject: *JSC.JSGlobalObject, object: *anyopaque) usize;
pub const JSPropertyIteratorOptions = struct {
skip_empty_name: bool,
include_value: bool,
Expand Down
10 changes: 5 additions & 5 deletions src/bun.js/bindings/bindings.zig
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ pub const CachedBytecode = opaque {
return null;
}

extern "C" fn CachedBytecode__deref(this: *CachedBytecode) void;
extern "c" fn CachedBytecode__deref(this: *CachedBytecode) void;
pub fn deref(this: *CachedBytecode) void {
return CachedBytecode__deref(this);
}
Expand Down Expand Up @@ -1338,7 +1338,7 @@ pub const FetchHeaders = opaque {
});
}

extern "C" fn WebCore__FetchHeaders__createFromJS(*JSC.JSGlobalObject, JSValue) ?*FetchHeaders;
extern "c" fn WebCore__FetchHeaders__createFromJS(*JSC.JSGlobalObject, JSValue) ?*FetchHeaders;
/// Construct a `Headers` object from a JSValue.
///
/// This can be:
Expand Down Expand Up @@ -2999,7 +2999,7 @@ pub const JSGlobalObject = opaque {
return this.ERR_INVALID_ARG_VALUE("The \"{s}\" argument is invalid. Received {}", .{ argname, actual_string_value }).throw();
}

extern "C" fn Bun__ErrorCode__determineSpecificType(*JSGlobalObject, JSValue) String;
extern "c" fn Bun__ErrorCode__determineSpecificType(*JSGlobalObject, JSValue) String;

pub fn determineSpecificType(global: *JSGlobalObject, value: JSValue) JSError!String {
const str = Bun__ErrorCode__determineSpecificType(global, value);
Expand Down Expand Up @@ -4251,7 +4251,7 @@ pub const JSValue = enum(i64) {
@import("./headers.zig").JSC__JSValue__put(value, global, key, result);
}

extern "C" fn JSC__JSValue__putBunString(value: JSValue, global: *JSGlobalObject, key: *const bun.String, result: JSC.JSValue) void;
extern "c" fn JSC__JSValue__putBunString(value: JSValue, global: *JSGlobalObject, key: *const bun.String, result: JSC.JSValue) void;
fn putBunString(value: JSValue, global: *JSGlobalObject, key: *const bun.String, result: JSC.JSValue) void {
if (comptime bun.Environment.isDebug)
JSC.markBinding(@src());
Expand Down Expand Up @@ -4650,7 +4650,7 @@ pub const JSValue = enum(i64) {
});
}

extern "C" fn JSC__JSValue__hasOwnPropertyValue(JSValue, *JSGlobalObject, JSValue) bool;
extern "c" fn JSC__JSValue__hasOwnPropertyValue(JSValue, *JSGlobalObject, JSValue) bool;
/// Calls `Object.hasOwnProperty(value)`.
/// Returns true if the object has the property, false otherwise
///
Expand Down
2 changes: 1 addition & 1 deletion src/bun.js/event_loop.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2509,7 +2509,7 @@ pub const PosixSignalHandle = struct {

pub const PosixSignalTask = struct {
number: u8,
extern "C" fn Bun__onSignalForJS(number: i32, globalObject: *JSC.JSGlobalObject) void;
extern "c" fn Bun__onSignalForJS(number: i32, globalObject: *JSC.JSGlobalObject) void;

pub usingnamespace bun.New(@This());
pub fn runFromJSThread(number: u8, globalObject: *JSC.JSGlobalObject) void {
Expand Down
6 changes: 3 additions & 3 deletions src/bun.js/javascript.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1584,9 +1584,9 @@ pub const VirtualMachine = struct {

pub const log = Output.scoped(.debugger, false);

extern "C" fn Bun__createJSDebugger(*JSGlobalObject) u32;
extern "C" fn Bun__ensureDebugger(u32, bool) void;
extern "C" fn Bun__startJSDebuggerThread(*JSGlobalObject, u32, *bun.String, c_int, bool) void;
extern "c" fn Bun__createJSDebugger(*JSGlobalObject) u32;
extern "c" fn Bun__ensureDebugger(u32, bool) void;
extern "c" fn Bun__startJSDebuggerThread(*JSGlobalObject, u32, *bun.String, c_int, bool) void;
var futex_atomic: std.atomic.Value(u32) = undefined;

pub fn waitForDebuggerIfNecessary(this: *VirtualMachine) void {
Expand Down
2 changes: 1 addition & 1 deletion src/bun.js/module_loader.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ pub const ModuleLoader = struct {
bun.default_allocator.free(this.string_buf);
}

extern "C" fn Bun__onFulfillAsyncModule(
extern "c" fn Bun__onFulfillAsyncModule(
globalObject: *JSGlobalObject,
promiseValue: JSValue,
res: *JSC.ErrorableResolvedSource,
Expand Down
2 changes: 1 addition & 1 deletion src/bun.js/node/path.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2814,7 +2814,7 @@ pub fn resolveJS_T(comptime T: type, globalObject: *JSC.JSGlobalObject, allocato
return if (isWindows) resolveWindowsJS_T(T, globalObject, paths, buf, buf2) else resolvePosixJS_T(T, globalObject, paths, buf, buf2);
}

extern "C" fn Process__getCachedCwd(*JSC.JSGlobalObject) JSC.JSValue;
extern "c" fn Process__getCachedCwd(*JSC.JSGlobalObject) JSC.JSValue;

pub fn resolve(globalObject: *JSC.JSGlobalObject, isWindows: bool, args_ptr: [*]JSC.JSValue, args_len: u16) callconv(JSC.conv) JSC.JSValue {
var arena = bun.ArenaAllocator.init(bun.default_allocator);
Expand Down
8 changes: 4 additions & 4 deletions src/bun.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,7 @@ pub fn reloadProcess(
}
} else if (comptime Environment.isPosix) {
const on_before_reload_process_linux = struct {
pub extern "C" fn on_before_reload_process_linux() void;
pub extern "c" fn on_before_reload_process_linux() void;
}.on_before_reload_process_linux;

on_before_reload_process_linux();
Expand Down Expand Up @@ -3251,7 +3251,7 @@ pub fn NewThreadSafeRefCounted(comptime T: type, comptime deinit_fn: ?fn (self:

pub fn exitThread() noreturn {
const exiter = struct {
pub extern "C" fn pthread_exit(?*anyopaque) noreturn;
pub extern "c" fn pthread_exit(?*anyopaque) noreturn;
pub extern "kernel32" fn ExitThread(windows.DWORD) noreturn;
};

Expand Down Expand Up @@ -3882,7 +3882,7 @@ pub fn tagName(comptime Enum: type, value: Enum) ?[:0]const u8 {
if (@intFromEnum(value) == f.value) break f.name;
} else null;
}
extern "C" fn Bun__ramSize() usize;
extern "c" fn Bun__ramSize() usize;
pub fn getTotalMemorySize() usize {
return Bun__ramSize();
}
Expand Down Expand Up @@ -4289,7 +4289,7 @@ pub const StackCheck = struct {
Bun__StackCheck__initialize();
}

extern "C" fn Bun__StackCheck__getMaxStack() usize;
extern "c" fn Bun__StackCheck__getMaxStack() usize;
fn getStackEnd() usize {
return Bun__StackCheck__getMaxStack();
}
Expand Down
8 changes: 4 additions & 4 deletions src/c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,11 @@ pub fn dlopen(filename: [:0]const u8, flags: C.RTLD) ?*anyopaque {
return std.c.dlopen(filename, flags);
}

pub extern "C" fn Bun__ttySetMode(fd: c_int, mode: c_int) c_int;
pub extern "c" fn Bun__ttySetMode(fd: c_int, mode: c_int) c_int;

pub extern "C" fn bun_initialize_process() void;
pub extern "C" fn bun_restore_stdio() void;
pub extern "C" fn open_as_nonblocking_tty(i32, i32) i32;
pub extern "c" fn bun_initialize_process() void;
pub extern "c" fn bun_restore_stdio() void;
pub extern "c" fn open_as_nonblocking_tty(i32, i32) i32;

pub extern fn strlen(ptr: [*c]const u8) usize;

Expand Down
2 changes: 1 addition & 1 deletion src/crash_handler.zig
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ pub fn handleSegfaultWindows(info: *windows.EXCEPTION_POINTERS) callconv(windows
);
}

extern "C" fn gnu_get_libc_version() ?[*:0]const u8;
extern "c" fn gnu_get_libc_version() ?[*:0]const u8;

pub fn printMetadata(writer: anytype) !void {
if (Output.enable_ansi_colors) {
Expand Down
2 changes: 1 addition & 1 deletion src/darwin_c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub const COPYFILE_CONTINUE = @as(c_int, 0);
pub const COPYFILE_SKIP = @as(c_int, 1);
pub const COPYFILE_QUIT = @as(c_int, 2);

pub extern "C" fn memmem(haystack: [*]const u8, haystacklen: usize, needle: [*]const u8, needlelen: usize) ?[*]const u8;
pub extern "c" fn memmem(haystack: [*]const u8, haystacklen: usize, needle: [*]const u8, needlelen: usize) ?[*]const u8;

// int clonefileat(int src_dirfd, const char * src, int dst_dirfd, const char * dst, int flags);
pub extern "c" fn clonefileat(c_int, [*:0]const u8, c_int, [*:0]const u8, uint32_t: c_int) c_int;
Expand Down
2 changes: 1 addition & 1 deletion src/deps/uws.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub const Socket = opaque {
debug("us_socket_write2({d}, {d}) = {d}", .{ first.len, second.len, rc });
return rc;
}
extern "C" fn us_socket_write2(ssl: i32, *Socket, header: ?[*]const u8, len: usize, payload: ?[*]const u8, usize) i32;
extern "c" fn us_socket_write2(ssl: i32, *Socket, header: ?[*]const u8, len: usize, payload: ?[*]const u8, usize) i32;
};
pub const ConnectingSocket = opaque {};
const debug = bun.Output.scoped(.uws, false);
Expand Down
2 changes: 1 addition & 1 deletion src/io/io.zig
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub const Loop = struct {
updateTimespec(&this.cached_now);
}

extern "C" fn clock_gettime_monotonic(sec: *i64, nsec: *i64) c_int;
extern "c" fn clock_gettime_monotonic(sec: *i64, nsec: *i64) c_int;
pub fn updateTimespec(timespec: *posix.timespec) void {
if (comptime Environment.isLinux) {
const rc = linux.clock_gettime(linux.CLOCK.MONOTONIC, timespec);
Expand Down
2 changes: 1 addition & 1 deletion src/js_ast.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8527,7 +8527,7 @@ pub const Macro = struct {
});
}

extern "C" fn Bun__startMacro(function: *const anyopaque, *anyopaque) void;
extern "c" fn Bun__startMacro(function: *const anyopaque, *anyopaque) void;
};
};

Expand Down
10 changes: 5 additions & 5 deletions src/linux_c.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const std = @import("std");
const bun = @import("root").bun;
pub extern "C" fn memmem(haystack: [*]const u8, haystacklen: usize, needle: [*]const u8, needlelen: usize) ?[*]const u8;
pub extern "c" fn memmem(haystack: [*]const u8, haystacklen: usize, needle: [*]const u8, needlelen: usize) ?[*]const u8;
pub const SystemErrno = enum(u8) {
SUCCESS = 0,
EPERM = 1,
Expand Down Expand Up @@ -606,15 +606,15 @@ pub const RWFFlagSupport = enum(u8) {
}
};

pub extern "C" fn sys_preadv2(
pub extern "c" fn sys_preadv2(
fd: c_int,
iov: [*]const std.posix.iovec,
iovcnt: c_int,
offset: std.posix.off_t,
flags: c_uint,
) isize;

pub extern "C" fn sys_pwritev2(
pub extern "c" fn sys_pwritev2(
fd: c_int,
iov: [*]const std.posix.iovec_const,
iovcnt: c_int,
Expand All @@ -630,8 +630,8 @@ pub const RENAME_NOREPLACE = 1 << 0;
pub const RENAME_EXCHANGE = 1 << 1;
pub const RENAME_WHITEOUT = 1 << 2;

pub extern "C" fn quick_exit(code: c_int) noreturn;
pub extern "C" fn memrchr(ptr: [*]const u8, val: c_int, len: usize) ?[*]const u8;
pub extern "c" fn quick_exit(code: c_int) noreturn;
pub extern "c" fn memrchr(ptr: [*]const u8, val: c_int, len: usize) ?[*]const u8;

export fn sys_epoll_pwait2(epfd: i32, events: ?[*]std.os.linux.epoll_event, maxevents: i32, timeout: ?*const std.os.linux.timespec, sigmask: ?*const std.os.linux.sigset_t) isize {
return @bitCast(
Expand Down
4 changes: 2 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ comptime {
}

extern fn bun_warn_avx_missing(url: [*:0]const u8) void;
pub extern "C" var _environ: ?*anyopaque;
pub extern "C" var environ: ?*anyopaque;
pub extern "c" var _environ: ?*anyopaque;
pub extern "c" var environ: ?*anyopaque;
pub fn main() void {
bun.crash_handler.init();

Expand Down
Loading

0 comments on commit fa50250

Please sign in to comment.