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

add missing implementation of os.getexepath for mac

This commit is contained in:
joe-conigliaro 2019-07-15 00:50:24 +10:00 committed by Alexander Medvednikov
parent 441281dd4f
commit 6c2e313155

View File

@ -520,8 +520,11 @@ pub fn getexepath() string {
}
$if mac {
//panic('getexepath() not impl')
return ''
mut bufsize := MAX_PATH // if buffer is too small this will be updated with size needed
if C._NSGetExecutablePath(result, &bufsize) == -1 {
panic('Could not get executable path, buffer too small (need: $bufsize).')
}
return tos(result, strlen(result))
}
}