mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
a545f17d2e
This adds true GOOS=wasip1 support in addition to our existing -target=wasi support. The old support for WASI isn't removed, but should be treated as deprecated and will likely be removed eventually to reduce the test burden.
24 lines
445 B
Go
24 lines
445 B
Go
//go:build linux || darwin || wasip1
|
|
|
|
package runtime
|
|
|
|
// int setenv(const char *name, const char *val, int replace);
|
|
//
|
|
//export setenv
|
|
func libc_setenv(name *byte, val *byte, replace int32) int32
|
|
|
|
// int unsetenv(const char *name);
|
|
//
|
|
//export unsetenv
|
|
func libc_unsetenv(name *byte) int32
|
|
|
|
func setenv(key, val *byte) {
|
|
// ignore any errors
|
|
libc_setenv(key, val, 1)
|
|
}
|
|
|
|
func unsetenv(key *byte) {
|
|
// ignore any errors
|
|
libc_unsetenv(key)
|
|
}
|