glfw: remove [*c] pointers from api and return lengthed strings when possible

This commit is contained in:
Silver 2021-11-11 09:42:49 +00:00 committed by Stephen Gutekanst
parent 28a0aebd95
commit 673ce14acf
8 changed files with 43 additions and 31 deletions

View file

@ -182,8 +182,8 @@ fn initHint(hint: InitHint, value: anytype) Error!void {
/// @pointer_lifetime The returned string is static and compile-time generated.
///
/// @thread_safety This function may be called from any thread.
pub inline fn getVersionString() [*c]const u8 {
return c.glfwGetVersionString();
pub inline fn getVersionString() [:0]const u8 {
return std.mem.span(c.glfwGetVersionString());
}
/// Processes all pending events.