aboutsummaryrefslogtreecommitdiff
path: root/src/watcher.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-27 23:20:10 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-27 23:20:10 -0800
commit50560e169ca39c0b4ec163cb32897baf7620aa69 (patch)
tree83eb721bfd4a0318874c1f69d254a4fd9446512b /src/watcher.zig
parent36c249e9c1fc6e0000d23ae0055eed54a5437c74 (diff)
downloadbun-50560e169ca39c0b4ec163cb32897baf7620aa69.tar.gz
bun-50560e169ca39c0b4ec163cb32897baf7620aa69.tar.zst
bun-50560e169ca39c0b4ec163cb32897baf7620aa69.zip
WASM
Diffstat (limited to 'src/watcher.zig')
-rw-r--r--src/watcher.zig15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/watcher.zig b/src/watcher.zig
index 35606f697..a5775071b 100644
--- a/src/watcher.zig
+++ b/src/watcher.zig
@@ -79,7 +79,7 @@ pub const INotify = struct {
pub var inotify_fd: EventListIndex = 0;
pub var loaded_inotify = false;
- const EventListBuffer = [@sizeOf([128]INotifyEvent) + (128 * std.fs.MAX_PATH_BYTES)]u8;
+ const EventListBuffer = [@sizeOf([128]INotifyEvent) + (128 * _global.MAX_PATH_BYTES)]u8;
var eventlist: EventListBuffer = undefined;
var eventlist_ptrs: [128]*const INotifyEvent = undefined;
@@ -193,12 +193,19 @@ const DarwinWatcher = struct {
}
};
+pub const Placeholder = struct {
+ pub const EventListIndex = u32;
+
+ pub var eventlist: [WATCHER_MAX_LIST]EventListIndex = undefined;
+ pub var eventlist_index: EventListIndex = 0;
+};
+
const PlatformWatcher = if (Environment.isMac)
DarwinWatcher
else if (Environment.isLinux)
INotify
else
- void;
+ Placeholder;
pub const WatchItem = struct {
file_path: string,
@@ -599,7 +606,7 @@ pub fn NewWatcher(comptime ContextType: type) type {
);
} else if (comptime Environment.isLinux) {
// var file_path_to_use_ = std.mem.trimRight(u8, file_path_, "/");
- // var buf: [std.fs.MAX_PATH_BYTES+1]u8 = undefined;
+ // var buf: [_global.MAX_PATH_BYTES+1]u8 = undefined;
// std.mem.copy(u8, &buf, file_path_to_use_);
// buf[file_path_to_use_.len] = 0;
var buf = file_path_.ptr;
@@ -683,7 +690,7 @@ pub fn NewWatcher(comptime ContextType: type) type {
);
} else if (Environment.isLinux) {
var file_path_to_use_ = std.mem.trimRight(u8, file_path_, "/");
- var buf: [std.fs.MAX_PATH_BYTES + 1]u8 = undefined;
+ var buf: [_global.MAX_PATH_BYTES + 1]u8 = undefined;
std.mem.copy(u8, &buf, file_path_to_use_);
buf[file_path_to_use_.len] = 0;
var slice: [:0]u8 = buf[0..file_path_to_use_.len :0];