Skip to content

Commit

Permalink
refactor: remove root.C
Browse files Browse the repository at this point in the history
  • Loading branch information
fel1x-developer committed Jan 14, 2025
1 parent e5ea345 commit 86b23a4
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ pub const completions = struct {
};

pub const JavaScriptCore = @import("./src/jsc.zig");
pub const C = @import("./src/c.zig");
2 changes: 1 addition & 1 deletion src/bun.js/node/node_os.zig
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fn cpusImplLinux(globalThis: *JSC.JSGlobalObject) !JSC.JSValue {

extern fn bun_sysconf__SC_CLK_TCK() isize;
fn cpusImplDarwin(globalThis: *JSC.JSGlobalObject) !JSC.JSValue {
const local_bindings = @import("../../darwin_c.zig");
const local_bindings = @import("../../c/darwin.zig");
const c = std.c;

// Fetch the CPU info structure
Expand Down
2 changes: 1 addition & 1 deletion src/bun.zig
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub const JSOOM = OOM || JSError;

pub const detectCI = @import("./ci_info.zig").detectCI;

pub const C = @import("root").C;
pub const C = @import("./c.zig");
pub const sha = @import("./sha.zig");
pub const FeatureFlags = @import("feature_flags.zig");
pub const meta = @import("./meta.zig");
Expand Down
10 changes: 5 additions & 5 deletions src/c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const Environment = @import("./env.zig");
pub const translated = @import("translated-c-headers");

const PlatformSpecific = switch (Environment.os) {
.mac => @import("./darwin_c.zig"),
.linux => @import("./linux_c.zig"),
.windows => @import("./windows_c.zig"),
.mac => @import("c/darwin.zig"),
.linux => @import("c/linux.zig"),
.windows => @import("c/windows.zig"),
else => struct {},
};
pub usingnamespace PlatformSpecific;
Expand All @@ -25,8 +25,8 @@ const mode_t = bun.Mode;
const libc_stat = bun.Stat;

const zeroes = mem.zeroes;
pub const darwin = @import("./darwin_c.zig");
pub const linux = @import("./linux_c.zig");
pub const darwin = @import("c/darwin.zig");
pub const linux = @import("c/linux.zig");
pub extern "c" fn chmod([*c]const u8, mode_t) c_int;
pub extern "c" fn fchmod(std.c.fd_t, mode_t) c_int;
pub extern "c" fn fchmodat(c_int, [*c]const u8, mode_t, c_int) c_int;
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/windows_c.zig → src/c/windows.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ pub const UV_EUNATCH = -uv.UV_EUNATCH;
pub const off_t = i64;
pub fn preallocate_file(_: posix.fd_t, _: off_t, _: off_t) !void {}

const uv = @import("./deps/libuv.zig");
const uv = @import("../deps/libuv.zig");

pub const E = enum(u16) {
SUCCESS = 0,
Expand Down
2 changes: 1 addition & 1 deletion src/glob/GlobWalker.zig
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Arena = std.heap.ArenaAllocator;
const ArrayList = std.ArrayListUnmanaged;
const ArrayListManaged = std.ArrayList;
const BunString = bun.String;
const C = @import("../c.zig");
const C = bun.C;
const CodepointIterator = @import("../string_immutable.zig").PackedCodepointIterator;
const Codepoint = CodepointIterator.Cursor.CodePointType;
const Dirent = @import("../bun.js/node/types.zig").Dirent;
Expand Down
2 changes: 1 addition & 1 deletion src/install/bin.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Global = bun.Global;
const std = @import("std");
const strings = bun.strings;
const Environment = @import("../env.zig");
const C = @import("../c.zig");
const C = bun.C;
const Fs = @import("../fs.zig");
const stringZ = bun.stringZ;
const Resolution = @import("./resolution.zig").Resolution;
Expand Down

0 comments on commit 86b23a4

Please sign in to comment.