From f66a3bc00d7dd14e2294e5b5c4f546162f96f30f Mon Sep 17 00:00:00 2001 From: anth64 Date: Sun, 25 Jan 2026 13:36:53 +0100 Subject: [PATCH] fix: legacy printf compatibility and add polling logs - Change %zu to %lu in stk_init to support older msvcrt.dll (Windows 7/XP) - Update pluralization logic to correctly handle "0 mods" vs "1 mod" - Add temporary stk_log calls to stk_poll for monitoring module events --- src/stk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/stk.c b/src/stk.c index 14965af..64cf7fa 100644 --- a/src/stk.c +++ b/src/stk.c @@ -93,8 +93,8 @@ int stk_init(const char *mod_dir, const char *tmp_dir) scanned: watch_handle = platform_directory_watch_start(stk_mod_dir); - stk_log(stdout, "[stk] stk v%s initialized! Loaded %zu mod%s from %s/", - STK_VERSION_STRING, module_count, module_count > 1 ? "s" : "", + stk_log(stdout, "[stk] stk v%s initialized! Loaded %lu mod%s from %s/", + STK_VERSION_STRING, module_count, module_count != 1 ? "s" : "", stk_mod_dir); return 0; } @@ -127,12 +127,15 @@ size_t stk_poll(void) switch (events[i]) { case STK_MOD_RELOAD: /* TODO: Implement reload */ + stk_log(stdout, "STK_MOD_RELOAD"); break; case STK_MOD_LOAD: /* TODO: Implement load */ + stk_log(stdout, "STK_MOD_LOAD"); break; case STK_MOD_UNLOAD: /* TODO: Implement unload */ + stk_log(stdout, "STK_MOD_UNLOAD"); break; } }