mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
update zig version
This commit is contained in:
6
flake.lock
generated
6
flake.lock
generated
@ -109,11 +109,11 @@
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1670113356,
|
||||
"narHash": "sha256-43aMRMU0OuBin6M2LM+nxVG+whazyHuHnUvu92xoth0=",
|
||||
"lastModified": 1670908544,
|
||||
"narHash": "sha256-SBlApO9OAnH2q4RqCHl8a2vZWhz/WAh+iojVM/k3bQ8=",
|
||||
"owner": "mitchellh",
|
||||
"repo": "zig-overlay",
|
||||
"rev": "17352071583eda4be43fa2a312f6e061326374f7",
|
||||
"rev": "066597fa3ed09d9c507f46a5850a392f451ef6cd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -77,7 +77,7 @@ pub const Blob = struct {
|
||||
comptime T: type,
|
||||
key: ?*anyopaque,
|
||||
ptr: ?*T,
|
||||
comptime destroycb: ?std.meta.FnPtr(fn (?*T) callconv(.C) void),
|
||||
comptime destroycb: ?*const fn (?*T) callconv(.C) void,
|
||||
replace: bool,
|
||||
) bool {
|
||||
const Callback = struct {
|
||||
|
@ -23,7 +23,7 @@ mutex: Mutex,
|
||||
cond: Cond,
|
||||
ready: bool = false,
|
||||
terminate: BoolAtomic,
|
||||
callback: std.meta.FnPtr(fn () void),
|
||||
callback: *const fn () void,
|
||||
thread: ?Thread,
|
||||
|
||||
/// Initialize a new embedder. The callback is called when libuv should
|
||||
@ -31,7 +31,7 @@ thread: ?Thread,
|
||||
pub fn init(
|
||||
alloc: Allocator,
|
||||
loop: Loop,
|
||||
callback: std.meta.FnPtr(fn () void),
|
||||
callback: *const fn () void,
|
||||
) !Embed {
|
||||
return Embed{
|
||||
.loop = loop,
|
||||
|
@ -79,7 +79,7 @@ pub fn MsgSend(comptime T: type) type {
|
||||
const Fn = MsgSendFn(RealReturn, @TypeOf(target.value), @TypeOf(args));
|
||||
// Due to this stage2 Zig issue[1], this must be var for now.
|
||||
// [1]: https://github.com/ziglang/zig/issues/13598
|
||||
var msg_send_ptr = @ptrCast(std.meta.FnPtr(Fn), msg_send_fn);
|
||||
var msg_send_ptr = @ptrCast(*const Fn, msg_send_fn);
|
||||
const result = @call(.{}, msg_send_ptr, .{ target.value, sel.value } ++ args);
|
||||
|
||||
if (!is_object) return result;
|
||||
|
@ -17,7 +17,7 @@ pub const Map = [freetype.c.FT_PIXEL_MODE_MAX]AtlasArray;
|
||||
/// to be exactly `width * rows * depth` long for freeing it. The caller must
|
||||
/// free the bitmap buffer. The depth is the depth of the atlas format in the
|
||||
/// map.
|
||||
pub const Func = std.meta.FnPtr(fn (Allocator, Bitmap) Allocator.Error!Bitmap);
|
||||
pub const Func = *const fn (Allocator, Bitmap) Allocator.Error!Bitmap;
|
||||
|
||||
/// Alias for the freetype FT_Bitmap type to make it easier to type.
|
||||
pub const Bitmap = freetype.c.struct_FT_Bitmap_;
|
||||
|
@ -13,13 +13,13 @@ pub threadlocal var context: Context = undefined;
|
||||
/// The getProcAddress param is an anytype so that we can accept multiple
|
||||
/// forms of the function depending on what we're interfacing with.
|
||||
pub fn load(getProcAddress: anytype) !c_int {
|
||||
const GlProc = std.meta.FnPtr(fn () callconv(.C) void);
|
||||
const GlfwFn = std.meta.FnPtr(fn ([*:0]const u8) callconv(.C) ?GlProc);
|
||||
const GlProc = *const fn () callconv(.C) void;
|
||||
const GlfwFn = *const fn ([*:0]const u8) callconv(.C) ?GlProc;
|
||||
|
||||
const res = switch (@TypeOf(getProcAddress)) {
|
||||
// glfw
|
||||
GlfwFn => c.gladLoadGLContext(&context, @ptrCast(
|
||||
std.meta.FnPtr(fn ([*c]const u8) callconv(.C) ?GlProc),
|
||||
*const fn ([*c]const u8) callconv(.C) ?GlProc,
|
||||
getProcAddress,
|
||||
)),
|
||||
|
||||
|
Reference in New Issue
Block a user