tinygo/src/runtime/env_windows.go
Ayke van Laethem 1996fad075 windows: add support for syscall.runtimeSetenv
I missed this in https://github.com/tinygo-org/tinygo/pull/3391 (because
I didn't test on Windows, my fault).
2023-02-03 07:31:38 -08:00

23 строки
459 Б
Go

//go:build windows
package runtime
// Set environment variable in Windows:
//
// BOOL SetEnvironmentVariableA(
// [in] LPCSTR lpName,
// [in, optional] LPCSTR lpValue
// );
//
//export SetEnvironmentVariableA
func _SetEnvironmentVariableA(key, val *byte) bool
func setenv(key, val *byte) {
// ignore any errors
_SetEnvironmentVariableA(key, val)
}
func unsetenv(key *byte) {
// ignore any errors
_SetEnvironmentVariableA(key, nil)
}