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.
This commit is contained in:
InKryption 2022-01-10 22:55:10 +01:00 committed by Stephen Gutekanst
parent abe9475d6e
commit d651d25903

View file

@ -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));