aboutsummaryrefslogtreecommitdiff
path: root/src/Clip.zig
diff options
context:
space:
mode:
authorGrace Yoder <grace_yoder@outlook.com>2026-06-30 10:02:29 -0600
committerGrace Yoder <grace_yoder@outlook.com>2026-06-30 16:33:26 -0600
commit9a377fa209cfecf53343247d197dc8578d6c2a1d (patch)
tree363b610d822ef6b855cf31873dfa097dd436d38f /src/Clip.zig
parent565174c4b8c73e9e28524709060335a0b17ee3fb (diff)
feat(NSPasteboard): uses backend when not ssh and on MacOS
Diffstat (limited to 'src/Clip.zig')
-rw-r--r--src/Clip.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Clip.zig b/src/Clip.zig
index 1adeeb0..b4e1187 100644
--- a/src/Clip.zig
+++ b/src/Clip.zig
@@ -1,5 +1,10 @@
+const std = @import("std");
+const builtin = @import("builtin");
+
pub const OSC52 = @import("Clip/OSC52.zig");
-// pub const PBCopy = if (@import("builtin").os.tag == .macos) @import("Clip/OSC52.zig") else null;
+// Ideally we would make else be `@compileError` but that
+// messes up with the interface checking
+pub const NSPasteboard = if (builtin.target.os.tag == .macos) @import("Clip/NSPasteboard.zig") else void;
// I am not sure if this is super idiomatic Zig or if this is bad practice, but
// by ensuring that all Clip backends implement the same methods, we are able
@@ -16,8 +21,6 @@ fn assertFn(comptime T: type, comptime name: []const u8, comptime Sig: type) voi
}
test {
- _ = @import("Clip/NSPasteBoard.zig");
-
inline for (@typeInfo(@This()).@"struct".decls) |decl| {
// Only grab types of structs
const T = @field(@This(), decl.name);