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:
parent
01531369f7
commit
43fb954234
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user