gpu: eliminate objc/message.h @cImport

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-19 21:01:24 -07:00
parent 0e14764ab2
commit 80e127b5ae
2 changed files with 10 additions and 3 deletions

View file

@ -0,0 +1,9 @@
// Extracted from `zig translate-c tmp.c` with `#include <objc/message.h>` in the file.
pub const struct_objc_selector = opaque {};
pub const SEL = ?*struct_objc_selector;
pub const Class = ?*struct_objc_class;
pub const struct_objc_class = opaque {};
pub extern fn sel_getUid(str: [*c]const u8) SEL;
pub extern fn objc_getClass(name: [*c]const u8) Class;
pub extern fn objc_msgSend() void;

View file

@ -2,9 +2,7 @@ const std = @import("std");
const assert = std.debug.assert; const assert = std.debug.assert;
const glfw = @import("glfw"); const glfw = @import("glfw");
const gpu = @import("gpu"); const gpu = @import("gpu");
const objc = @cImport({ const objc = @import("objc_message.zig");
@cInclude("objc/message.h");
});
inline fn printUnhandledErrorCallback(_: void, typ: gpu.ErrorType, message: [*:0]const u8) void { inline fn printUnhandledErrorCallback(_: void, typ: gpu.ErrorType, message: [*:0]const u8) void {
switch (typ) { switch (typ) {