solaris: another fix

pull/2125/head^2
Alexander Medvednikov 2019-09-27 00:30:41 +03:00
parent fcf8f7fc93
commit 74bbf592d1
2 changed files with 11 additions and 2 deletions

View File

@ -42,6 +42,8 @@ enum OS {
dragonfly dragonfly
msvc msvc
js js
android
solaris
} }
enum Pass { enum Pass {
@ -799,6 +801,9 @@ fn new_v(args[]string) &V {
$if dragonfly { $if dragonfly {
_os = .dragonfly _os = .dragonfly
} }
$if solaris {
_os = .solaris
}
} }
else { else {
switch target_os { switch target_os {
@ -811,6 +816,7 @@ fn new_v(args[]string) &V {
case 'dragonfly': _os = .dragonfly case 'dragonfly': _os = .dragonfly
case 'msvc': _os = .msvc case 'msvc': _os = .msvc
case 'js': _os = .js case 'js': _os = .js
case 'solaris': _os = .solaris
} }
} }
//println('OS=$_os') //println('OS=$_os')

View File

@ -542,6 +542,9 @@ pub fn user_os() string {
$if android{ $if android{
return 'android' return 'android'
} }
$if solaris {
return 'solaris'
}
return 'unknown' return 'unknown'
} }
@ -631,8 +634,8 @@ pub fn executable() string {
// lol // lol
return os.args[0] return os.args[0]
} }
//$if solaris { $if solaris {
//} }
$if netbsd { $if netbsd {
mut result := malloc(MAX_PATH) mut result := malloc(MAX_PATH)
count := int(C.readlink('/proc/curproc/exe', result, MAX_PATH )) count := int(C.readlink('/proc/curproc/exe', result, MAX_PATH ))