diff --git a/compiler/main.v b/compiler/main.v index 9e0aa492b3..c4571a6eb8 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -42,6 +42,8 @@ enum OS { dragonfly msvc js + android + solaris } enum Pass { @@ -799,6 +801,9 @@ fn new_v(args[]string) &V { $if dragonfly { _os = .dragonfly } + $if solaris { + _os = .solaris + } } else { switch target_os { @@ -811,6 +816,7 @@ fn new_v(args[]string) &V { case 'dragonfly': _os = .dragonfly case 'msvc': _os = .msvc case 'js': _os = .js + case 'solaris': _os = .solaris } } //println('OS=$_os') diff --git a/vlib/os/os.v b/vlib/os/os.v index 2f3d322fe5..7c7ec2013c 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -542,6 +542,9 @@ pub fn user_os() string { $if android{ return 'android' } + $if solaris { + return 'solaris' + } return 'unknown' } @@ -631,8 +634,8 @@ pub fn executable() string { // lol return os.args[0] } - //$if solaris { - //} + $if solaris { + } $if netbsd { mut result := malloc(MAX_PATH) count := int(C.readlink('/proc/curproc/exe', result, MAX_PATH ))