From cbc3cc94d8139e0355a463a2bf342d0c7da2d13f Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Sat, 31 Oct 2026 13:59:28 +0300 Subject: [PATCH] Set the probe's environment through plat_setenv so astc_probe.c builds on Linux astc_probe.c came from dev with _putenv_s, which the Linux build of the merged runtime rejects. check_platform.py now flags _putenv and _putenv_s in shared files. Co-Authored-By: Claude Opus 5.5 --- runtime/astc_probe.c | 2 +- tools/check_platform.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/astc_probe.c b/runtime/astc_probe.c index b7718b4f..41d61fc1 100644 --- a/runtime/astc_probe.c +++ b/runtime/astc_probe.c @@ -355,7 +355,7 @@ static void timing(VkCtx *c, uint32_t bw, uint32_t bh) { } int probe_astc(void) { - _putenv_s("TOTK_ASTC_BC", "1"); // also builds the BC3 encoder; the RGBA8 cases pass bc 0 and do not use it + plat_setenv("TOTK_ASTC_BC", "1"); // also builds the BC3 encoder; the RGBA8 cases pass bc 0 and do not use it if (!vk_init()) { printf("probe-astc: FAIL vk_init\n"); return 1; } VkCtx *c = vk_ctx(); printf("probe-astc: GPU %s, textureCompressionASTC_LDR %d, mode %d\n", c->props.deviceName, c->has_astc_ldr, diff --git a/tools/check_platform.py b/tools/check_platform.py index 07528b3d..8b9ac245 100644 --- a/tools/check_platform.py +++ b/tools/check_platform.py @@ -36,7 +36,7 @@ CALLS = [ "SuspendThread", "ResumeThread", "GetThreadContext", "SetThreadContext", "OpenThread", "CreateFiber(Ex)?", "ConvertThreadToFiber(Ex)?", "ConvertFiberToThread", "SwitchToFiber", "DeleteFiber", "BCrypt[A-Za-z]*", "_aligned_malloc", "_aligned_free", "_stricmp", "_strnicmp", "_strdup", "_wfopen", "_fseeki64", "_ftelli64", - "localtime_s", "strtok_s", "GetModuleHandle(Ex)?[AW]?", "ExitProcess", "SetEnvironmentVariable[AW]?", + "localtime_s", "strtok_s", "GetModuleHandle(Ex)?[AW]?", "ExitProcess", "SetEnvironmentVariable[AW]?", "_putenv(_s)?", "GetLastError", "MultiByteToWideChar", "WideCharToMultiByte", "HWND", "LARGE_INTEGER", "FILETIME", "MAX_PATH", "GetActiveProcessorCount", "timeBeginPeriod", ]