From d651d25903270c8291fe506eb5a1477a9025d9b9 Mon Sep 17 00:00:00 2001 From: InKryption <59504965+InKryption@users.noreply.github.com> Date: Mon, 10 Jan 2022 22:55:10 +0100 Subject: [PATCH] glfw: Use `anyopaque` instead of `opaque{}` Using an inline `opaque{}` type forces the use of `@typeInfo` to cast to the specific type of the parameter. --- glfw/src/vulkan.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glfw/src/vulkan.zig b/glfw/src/vulkan.zig index f803adf7..f83fe3da 100644 --- a/glfw/src/vulkan.zig +++ b/glfw/src/vulkan.zig @@ -109,7 +109,7 @@ pub const VKProc = fn () callconv(.C) void; /// @pointer_lifetime The returned function pointer is valid until the library is terminated. /// /// @thread_safety This function may be called from any thread. -pub fn getInstanceProcAddress(vk_instance: ?*opaque {}, proc_name: [*:0]const u8) callconv(.C) ?VKProc { +pub fn getInstanceProcAddress(vk_instance: ?*anyopaque, proc_name: [*:0]const u8) callconv(.C) ?VKProc { internal_debug.assertInitialized(); const proc_address = c.glfwGetInstanceProcAddress(if (vk_instance) |v| @ptrCast(c.VkInstance, v) else null, proc_name); getError() catch |err| @panic(@errorName(err));