Fix session file scanning on 32-bit Android

This commit is contained in:
waozi committed 2026-10-10 11:15:45 -03:00
1 parent e8fd60483a
commit d6298bba92
3 files changed
+18 -1

No files matched your search

-1
View File
@@ -8,7 +8,6 @@ c :: #system_library "c";
// The layout of raylib's FilePathList, which the host returns by value.
LegacyPaths :: struct {
capacity: u32
count: u32
paths: **u8
}
+15
View File
@@ -0,0 +1,15 @@
#include "storage/legacy_session_files.h"
#include "raylib.h"
#include <stddef.h>
/* Check the native boundary, rather than repeating the Ziran layout in a mock. */
_Static_assert(sizeof(LegacyPaths) == sizeof(FilePathList),
"LegacyPaths must match raylib's FilePathList size");
_Static_assert(_Alignof(LegacyPaths) == _Alignof(FilePathList),
"LegacyPaths must match raylib's FilePathList alignment");
_Static_assert(offsetof(LegacyPaths, count) == offsetof(FilePathList, count),
"LegacyPaths must read raylib's real entry count");
_Static_assert(offsetof(LegacyPaths, paths) == offsetof(FilePathList, paths),
"LegacyPaths must read raylib's real path pointer");
_Static_assert(sizeof(((LegacyPaths *)0)->count) == sizeof(((FilePathList *)0)->count),
"LegacyPaths must match raylib's entry count width");
+3
View File
@@ -17,6 +17,9 @@ mkdir -p "$work/generated"
"$bin/zi2c" --no-main --root "$root/src" \
--module-path "$root/build/packages/ziran/std" \
-o "$work/generated" "$root/src/storage/legacy_session_zip.zi"
"${CC:-cc}" -std=c11 -fsyntax-only -I"$root/build/packages/ziran/include" \
-I"$work/generated" -I"$root/build/packages/raylib/src" \
"$root/tests/legacy_session_paths_abi_test.c"
"${CC:-cc}" -std=c11 -O0 -I"$root/build/packages/ziran/include" \
-I"$work/generated" "$root/tests/legacy_session_zi_test.c" \
"$work/generated/c_string.c" \