Commit Graph

10 Commits

Author SHA1 Message Date
Peterino2 264ffc99c4 Port to Zig 0.17 and fix codegen correctness
Zig 0.17 port
- build.zig: custom steps are gone in 0.17; archive/mkdir/write/rmtree
  now run through a small helper executable (src/build_helper.zig)
- sources use std.Io for files, processes and time, std.process.Init
  for main, and the unmanaged ArrayList / Io.Writer APIs
- generated code uses callconv(.c), @backingInt and @fromBackingInt

Codegen fixes
- enums: token based enum body parser. Members without a trailing
  comment (`NAME = value,`), with plain or multi-line comments, or
  without a trailing comma were dropped or broke the output. Values are
  numbered like C, duplicates become aliases, byte order conditionals
  use the little endian branch
- flags: packed struct fields are emitted by bit position with padding
  for gaps instead of in declaration order
- structs/unions: a field followed by a multi-line comment was dropped
- casts are derived from how a type is declared instead of from its
  name: pointers to SDL types use @ptrCast(@alignCast()), enums go
  through @intCast, by-value structs are reinterpreted through a pointer
- `void *` struct fields are `?*anyopaque` (was the invalid
  `[*c]anyopaque`); `struct X *` typedefs are `?*anyopaque`
- `const char *const *` spelling is handled
- SDL_guid.h and SDL_pen.h are generated since other modules import them

Build and tooling
- --skip-missing: headers a release does not ship (SDL_tray.h in 3.1.6)
  are skipped instead of failing the build
- --basedir only relocates tmp/debug/archive; input and output paths
  stay relative to the invocation directory
- `zig build fetch-sdl` no longer archives api/ and json/
- all module tests run under `zig build test`; stale mock tests updated
- release lists updated through SDL 3.4.20
2026-11-13 02:56:54 +00:00
peterino2 27157135ed updated generated files 2026-03-07 10:54:39 -08:00
peterino2 cca2376228 updates to sdl-parserscrap 2026-03-07 10:41:05 -08:00
searzocom 16bea32e5a Update README.md 2026-01-26 18:08:09 +00:00
peterino2 77fc6b3c4b saving 2026-01-26 01:54:37 -08:00
peterino2 209f07df35 saving 2026-01-26 01:54:12 -08:00
peterino2 19b392e9aa updated readme 2026-01-26 01:50:59 -08:00
peterino2 4ffb701a36 saving 2026-01-24 17:36:02 -08:00
peterino2 e906b8a673 lots of vegan coding tonight, hands on cleanup of a lot of parsing edge cases, added significant upgrades to the build system so we can fetch sdl versions from both castholm's zig version and the official one 2026-01-24 01:45:17 -08:00
Peter Li d46a412328 saving 2026-01-23 18:16:11 -08:00