update zig version

This commit is contained in:
Mitchell Hashimoto
2022-12-12 22:10:52 -08:00
parent 0ab8eff069
commit c8252133a3
6 changed files with 11 additions and 11 deletions

6
flake.lock generated
View File

@ -109,11 +109,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1670113356, "lastModified": 1670908544,
"narHash": "sha256-43aMRMU0OuBin6M2LM+nxVG+whazyHuHnUvu92xoth0=", "narHash": "sha256-SBlApO9OAnH2q4RqCHl8a2vZWhz/WAh+iojVM/k3bQ8=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "17352071583eda4be43fa2a312f6e061326374f7", "rev": "066597fa3ed09d9c507f46a5850a392f451ef6cd",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -77,7 +77,7 @@ pub const Blob = struct {
comptime T: type, comptime T: type,
key: ?*anyopaque, key: ?*anyopaque,
ptr: ?*T, ptr: ?*T,
comptime destroycb: ?std.meta.FnPtr(fn (?*T) callconv(.C) void), comptime destroycb: ?*const fn (?*T) callconv(.C) void,
replace: bool, replace: bool,
) bool { ) bool {
const Callback = struct { const Callback = struct {

View File

@ -23,7 +23,7 @@ mutex: Mutex,
cond: Cond, cond: Cond,
ready: bool = false, ready: bool = false,
terminate: BoolAtomic, terminate: BoolAtomic,
callback: std.meta.FnPtr(fn () void), callback: *const fn () void,
thread: ?Thread, thread: ?Thread,
/// Initialize a new embedder. The callback is called when libuv should /// Initialize a new embedder. The callback is called when libuv should
@ -31,7 +31,7 @@ thread: ?Thread,
pub fn init( pub fn init(
alloc: Allocator, alloc: Allocator,
loop: Loop, loop: Loop,
callback: std.meta.FnPtr(fn () void), callback: *const fn () void,
) !Embed { ) !Embed {
return Embed{ return Embed{
.loop = loop, .loop = loop,

View File

@ -79,7 +79,7 @@ pub fn MsgSend(comptime T: type) type {
const Fn = MsgSendFn(RealReturn, @TypeOf(target.value), @TypeOf(args)); const Fn = MsgSendFn(RealReturn, @TypeOf(target.value), @TypeOf(args));
// Due to this stage2 Zig issue[1], this must be var for now. // Due to this stage2 Zig issue[1], this must be var for now.
// [1]: https://github.com/ziglang/zig/issues/13598 // [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); const result = @call(.{}, msg_send_ptr, .{ target.value, sel.value } ++ args);
if (!is_object) return result; if (!is_object) return result;

View File

@ -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 /// 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 /// free the bitmap buffer. The depth is the depth of the atlas format in the
/// map. /// 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. /// Alias for the freetype FT_Bitmap type to make it easier to type.
pub const Bitmap = freetype.c.struct_FT_Bitmap_; pub const Bitmap = freetype.c.struct_FT_Bitmap_;

View File

@ -13,13 +13,13 @@ pub threadlocal var context: Context = undefined;
/// The getProcAddress param is an anytype so that we can accept multiple /// The getProcAddress param is an anytype so that we can accept multiple
/// forms of the function depending on what we're interfacing with. /// forms of the function depending on what we're interfacing with.
pub fn load(getProcAddress: anytype) !c_int { pub fn load(getProcAddress: anytype) !c_int {
const GlProc = std.meta.FnPtr(fn () callconv(.C) void); const GlProc = *const fn () callconv(.C) void;
const GlfwFn = std.meta.FnPtr(fn ([*:0]const u8) callconv(.C) ?GlProc); const GlfwFn = *const fn ([*:0]const u8) callconv(.C) ?GlProc;
const res = switch (@TypeOf(getProcAddress)) { const res = switch (@TypeOf(getProcAddress)) {
// glfw // glfw
GlfwFn => c.gladLoadGLContext(&context, @ptrCast( GlfwFn => c.gladLoadGLContext(&context, @ptrCast(
std.meta.FnPtr(fn ([*c]const u8) callconv(.C) ?GlProc), *const fn ([*c]const u8) callconv(.C) ?GlProc,
getProcAddress, getProcAddress,
)), )),