From 7474c1f0da5bbc9dd613e330d5dbff745a0b63bf Mon Sep 17 00:00:00 2001 From: favhly Date: Sat, 28 Nov 2026 20:56:06 +0100 Subject: [PATCH 1/2] Add missing header for SDL_REVISION macro --- src/sdl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sdl.h b/src/sdl.h index a897cf086..f35be0d37 100644 --- a/src/sdl.h +++ b/src/sdl.h @@ -40,6 +40,9 @@ // Include the main SDL header, this header provides most other SDL headers. #include +// Include the SDL revision header, this header defines the SDL_REVISION macro. +#include + // This is not pulling in the full Vulkan API to every build. It's just pulling in a few functions // that can be called to load the API and integrate with SDL. #include From 325ce1f2773f0eff361fa2eefb0f7c333ee93654 Mon Sep 17 00:00:00 2001 From: Favhly Date: Sat, 28 Nov 2026 21:44:35 +0100 Subject: [PATCH 2/2] Add SDL_VENDOR_INFO macro to translate c --- build.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.zig b/build.zig index 9fa4fe8db..a86589c82 100644 --- a/build.zig +++ b/build.zig @@ -63,6 +63,8 @@ pub fn build(b: *std.Build) !void { assert(sdl_so_version.major == 3); sdl_so_version.major = 0; + const sdl_vendor_info = std.fmt.comptimePrint("\"{s} {s}\"", .{"https://github.com/allyourcodebase/SDL", build_zon.version}); + // Create the library const lib = b.addLibrary(.{ .name = "SDL3", @@ -81,10 +83,7 @@ pub fn build(b: *std.Build) !void { }, .static => lib.root_module.addCMacro("SDL_STATIC_LIB", "1"), } - lib.root_module.addCMacro("SDL_VENDOR_INFO", std.fmt.comptimePrint("\"{s} {s}\"", .{ - "https://github.com/allyourcodebase/SDL", - build_zon.version, - })); + lib.root_module.addCMacro("SDL_VENDOR_INFO", sdl_vendor_info); lib.installHeadersDirectory(upstream.path("include/SDL3"), "SDL3", .{}); b.installArtifact(lib); @@ -147,6 +146,7 @@ pub fn build(b: *std.Build) !void { .optimize = optimize orelse std.builtin.OptimizeMode.Debug, }); translate_c.defineCMacro("USING_GENERATED_CONFIG_H", "1"); + translate_c.defineCMacro("SDL_VENDOR_INFO", sdl_vendor_info); translate_c.addIncludePath(upstream.path("include")); translate_c.addIncludePath(upstream.path("src/video/khronos")); const module = translate_c.addModule("sdl3");