mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: remove private unix_environ() helper function, it is not needed anymore (#15654)
This commit is contained in:
parent
0c84ad847e
commit
45e21bc311
@ -79,11 +79,6 @@ pub fn unsetenv(name string) int {
|
||||
// See: https://docs.microsoft.com/bg-bg/windows/win32/api/processenv/nf-processenv-getenvironmentstrings
|
||||
// os.environ returns a map of all the current environment variables
|
||||
|
||||
fn unix_environ() &&char {
|
||||
// TODO: remove this helper function, when `&&char(C.environ)` works properly
|
||||
return voidptr(C.environ)
|
||||
}
|
||||
|
||||
pub fn environ() map[string]string {
|
||||
mut res := map[string]string{}
|
||||
$if windows {
|
||||
@ -101,7 +96,7 @@ pub fn environ() map[string]string {
|
||||
}
|
||||
C.FreeEnvironmentStringsW(estrings)
|
||||
} $else {
|
||||
start := unix_environ()
|
||||
start := &&char(C.environ)
|
||||
mut i := 0
|
||||
for {
|
||||
x := unsafe { start[i] }
|
||||
|
Loading…
Reference in New Issue
Block a user