{mach,gpu}: fix accidental inclusion of objc/message.h on non-darwin platforms
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
eb0eceb707
commit
f5d34e1247
2 changed files with 16 additions and 8 deletions
|
|
@ -204,10 +204,16 @@ pub fn createSurfaceForWindow(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const AutoReleasePool = opaque {
|
pub const AutoReleasePool = if (!@import("builtin").target.isDarwin()) opaque {
|
||||||
pub fn init() error{OutOfMemory}!?*AutoReleasePool {
|
pub fn init() error{OutOfMemory}!?*AutoReleasePool {
|
||||||
if (!@import("builtin").target.isDarwin()) return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn release(pool: ?*AutoReleasePool) void {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else opaque {
|
||||||
|
pub fn init() error{OutOfMemory}!?*AutoReleasePool {
|
||||||
// pool = [NSAutoreleasePool alloc];
|
// pool = [NSAutoreleasePool alloc];
|
||||||
var pool = msgSend(objc.objc_getClass("NSAutoreleasePool"), "alloc", .{}, ?*AutoReleasePool);
|
var pool = msgSend(objc.objc_getClass("NSAutoreleasePool"), "alloc", .{}, ?*AutoReleasePool);
|
||||||
if (pool == null) return error.OutOfMemory;
|
if (pool == null) return error.OutOfMemory;
|
||||||
|
|
@ -220,8 +226,6 @@ pub const AutoReleasePool = opaque {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn release(pool: ?*AutoReleasePool) void {
|
pub fn release(pool: ?*AutoReleasePool) void {
|
||||||
if (!@import("builtin").target.isDarwin()) return;
|
|
||||||
|
|
||||||
// [pool release];
|
// [pool release];
|
||||||
msgSend(pool, "release", .{}, void);
|
msgSend(pool, "release", .{}, void);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,10 +137,16 @@ pub fn createSurfaceForWindow(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const AutoReleasePool = opaque {
|
pub const AutoReleasePool = if (!@import("builtin").target.isDarwin()) opaque {
|
||||||
pub fn init() error{OutOfMemory}!?*AutoReleasePool {
|
pub fn init() error{OutOfMemory}!?*AutoReleasePool {
|
||||||
if (!@import("builtin").target.isDarwin()) return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn release(pool: ?*AutoReleasePool) void {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else opaque {
|
||||||
|
pub fn init() error{OutOfMemory}!?*AutoReleasePool {
|
||||||
// pool = [NSAutoreleasePool alloc];
|
// pool = [NSAutoreleasePool alloc];
|
||||||
var pool = msgSend(objc.objc_getClass("NSAutoreleasePool"), "alloc", .{}, ?*AutoReleasePool);
|
var pool = msgSend(objc.objc_getClass("NSAutoreleasePool"), "alloc", .{}, ?*AutoReleasePool);
|
||||||
if (pool == null) return error.OutOfMemory;
|
if (pool == null) return error.OutOfMemory;
|
||||||
|
|
@ -153,8 +159,6 @@ pub const AutoReleasePool = opaque {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn release(pool: ?*AutoReleasePool) void {
|
pub fn release(pool: ?*AutoReleasePool) void {
|
||||||
if (!@import("builtin").target.isDarwin()) return;
|
|
||||||
|
|
||||||
// [pool release];
|
// [pool release];
|
||||||
msgSend(pool, "release", .{}, void);
|
msgSend(pool, "release", .{}, void);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue