1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

os: fix executable on FreeBSD and older C compilers

This commit is contained in:
Alexander Medvednikov 2019-08-04 00:16:37 +02:00
parent 01531369f7
commit 43fb954234

View File

@ -692,9 +692,9 @@ pub fn executable() string {
}
$if freebsd {
mut result := malloc(MAX_PATH)
mut mib := [1 /* CTL_KERN */, 14 /* KERN_PROC */, 12 /* KERN_PROC_PATHNAME */, -1]!!
mib := [1 /* CTL_KERN */, 14 /* KERN_PROC */, 12 /* KERN_PROC_PATHNAME */, -1]
size := MAX_PATH
C.sysctl(mib, 4, result, &size, 0, 0)
C.sysctl(mib.data, 4, result, &size, 0, 0)
return string(result)
}
$if openbsd {