pkg/objc: more message send stuff

This commit is contained in:
Mitchell Hashimoto
2022-10-25 20:55:41 -07:00
parent f587b222e7
commit aaaae38fa1
5 changed files with 47 additions and 3 deletions

View File

@@ -1,6 +1,11 @@
const std = @import("std");
const c = @import("c.zig");
// Shorthand, equivalent to Sel.registerName
pub inline fn sel(name: [:0]const u8) Sel {
return Sel.registerName(name);
}
pub const Sel = struct {
value: c.SEL,
@@ -20,6 +25,6 @@ pub const Sel = struct {
test {
const testing = std.testing;
const sel = Sel.registerName("yo");
try testing.expectEqualStrings("yo", sel.getName());
const s = Sel.registerName("yo");
try testing.expectEqualStrings("yo", s.getName());
}