From 9a377fa209cfecf53343247d197dc8578d6c2a1d Mon Sep 17 00:00:00 2001 From: Grace Yoder Date: Tue, 30 Jun 2026 10:02:29 -0600 Subject: feat(NSPasteboard): uses backend when not ssh and on MacOS --- src/Clip.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Clip.zig') 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); -- cgit v1.3.1