mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-25 22:15:57 +00:00
Remove environment variables with plat_setenv(name, NULL) and set them through the C runtime on Windows, so getenv sees every change and --probe-cfg passes on Linux.
This commit is contained in:
1 parent
efe1b5db54
commit
a4c99a47b0
3 files changed
+18
-16
No files matched your search
@@ -621,7 +621,9 @@ void plat_exit(int code) {
|
||||
ExitProcess((UINT)code);
|
||||
}
|
||||
|
||||
int plat_setenv(const char *name, const char *value) { return SetEnvironmentVariableA(name, value) != 0; }
|
||||
// _putenv_s, not SetEnvironmentVariableA: getenv reads the C runtime's copy of the environment, which only the CRT's
|
||||
// own calls update. An empty value removes the variable.
|
||||
int plat_setenv(const char *name, const char *value) { return _putenv_s(name, value ? value : "") == 0; }
|
||||
|
||||
uint32_t plat_process_id(void) { return GetCurrentProcessId(); }
|
||||
|
||||
|
||||
Reference in new issue
Block a user