mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
config: fix build on iOS for error set
This commit is contained in:
@ -34,7 +34,16 @@ pub const Location = enum {
|
|||||||
break :user internal_os.xdg.config(
|
break :user internal_os.xdg.config(
|
||||||
arena_alloc,
|
arena_alloc,
|
||||||
.{ .subdir = subdir },
|
.{ .subdir = subdir },
|
||||||
) catch |err| switch (err) {
|
) catch |err| {
|
||||||
|
// We need to do some comptime trick sot get the right
|
||||||
|
// error set since some platforms don't support some
|
||||||
|
// error types.
|
||||||
|
const Error = @TypeOf(err) || switch (builtin.os.tag) {
|
||||||
|
.ios => error{BufferTooSmall},
|
||||||
|
else => error{},
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (@as(Error, err)) {
|
||||||
error.OutOfMemory => return error.OutOfMemory,
|
error.OutOfMemory => return error.OutOfMemory,
|
||||||
error.BufferTooSmall => return error.OutOfMemory,
|
error.BufferTooSmall => return error.OutOfMemory,
|
||||||
|
|
||||||
@ -42,6 +51,7 @@ pub const Location = enum {
|
|||||||
// existing. Windows in particularly can return a LOT
|
// existing. Windows in particularly can return a LOT
|
||||||
// of errors here.
|
// of errors here.
|
||||||
else => return null,
|
else => return null,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user