From ca82b330f41abc5da1049d134c65223e7ef10f07 Mon Sep 17 00:00:00 2001 From: "Wolfgang E. Sanyer" Date: Tue, 12 May 2026 14:19:43 -0400 Subject: [PATCH] Update to work with zig 0.17.0-dev.304+9787df942 --- src/sdl2.zig | 16 ++++++++-------- src/sdl3.zig | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/sdl2.zig b/src/sdl2.zig index de1147b..fb66d85 100644 --- a/src/sdl2.zig +++ b/src/sdl2.zig @@ -156,7 +156,7 @@ extern fn SDL_LogResetPriorities() void; pub fn log(comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -174,7 +174,7 @@ extern fn SDL_Log(fmt: [*:0]const u8, ...) void; pub fn logVerbose(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -192,7 +192,7 @@ extern fn SDL_LogVerbose(category: c_int, fmt: [*:0]const u8, ...) void; pub fn logDebug(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -210,7 +210,7 @@ extern fn SDL_LogDebug(category: c_int, fmt: [*:0]const u8, ...) void; pub fn logInfo(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -228,7 +228,7 @@ extern fn SDL_LogInfo(category: c_int, fmt: [*:0]const u8, ...) void; pub fn logWarn(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -246,7 +246,7 @@ extern fn SDL_LogWarn(category: c_int, fmt: [*:0]const u8, ...) void; pub fn logError(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -264,7 +264,7 @@ extern fn SDL_LogError(category: c_int, fmt: [*:0]const u8, ...) void; pub fn logCritical(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -282,7 +282,7 @@ extern fn SDL_LogCritical(category: c_int, fmt: [*:0]const u8, ...) void; pub fn logMessage(category: LogCategory, priority: LogPriority, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), diff --git a/src/sdl3.zig b/src/sdl3.zig index c28e66a..ccc65b0 100644 --- a/src/sdl3.zig +++ b/src/sdl3.zig @@ -351,7 +351,7 @@ extern fn SDL_SetLogPriorityPrefix(priority: LogPriority, prefix: [*c]const u8) pub fn log(comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -369,7 +369,7 @@ extern fn SDL_Log(fmt: [*c]const u8, ...) void; pub fn logTrace(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -387,7 +387,7 @@ extern fn SDL_LogTrace(category: c_int, fmt: [*c]const u8, ...) void; pub fn logVerbose(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -405,7 +405,7 @@ extern fn SDL_LogVerbose(category: c_int, fmt: [*c]const u8, ...) void; pub fn logDebug(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -423,7 +423,7 @@ extern fn SDL_LogDebug(category: c_int, fmt: [*c]const u8, ...) void; pub fn logInfo(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -441,7 +441,7 @@ extern fn SDL_LogInfo(category: c_int, fmt: [*c]const u8, ...) void; pub fn logWarn(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -459,7 +459,7 @@ extern fn SDL_LogWarn(category: c_int, fmt: [*c]const u8, ...) void; pub fn logError(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -477,7 +477,7 @@ extern fn SDL_LogError(category: c_int, fmt: [*c]const u8, ...) void; pub fn logCritical(category: LogCategory, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert), @@ -495,7 +495,7 @@ extern fn SDL_LogCritical(category: c_int, fmt: [*c]const u8, ...) void; pub fn logMessage(category: LogCategory, priority: LogPriority, comptime fmt: []const u8, args: anytype) void { assert(fmt.len > 0 and fmt.len < max_log_message - 1); var buf: [max_log_message]u8 = undefined; - const message = std.fmt.bufPrintZ(&buf, fmt, args) catch |err| switch (err) { + const message = std.fmt.bufPrintSentinel(&buf, fmt, args, 0) catch |err| switch (err) { std.fmt.BufPrintError.NoSpaceLeft => { SDL_LogError( @intFromEnum(LogCategory.assert),