mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 07:53:40 +00:00
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).
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
//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)
|
||||
}
|
||||
Reference in New Issue
Block a user