gpu: eliminate objc/message.h @cImport
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
0e14764ab2
commit
80e127b5ae
2 changed files with 10 additions and 3 deletions
9
gpu/examples/objc_message.zig
Normal file
9
gpu/examples/objc_message.zig
Normal 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;
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue