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

solaris support

This commit is contained in:
Alexander Medvednikov 2019-09-27 00:23:27 +03:00
parent fb4f14ba76
commit 107e9107c8
3 changed files with 6 additions and 2 deletions

View File

@ -277,6 +277,7 @@ fn os_name_to_ifdef(name string) string {
case 'msvc': return '_MSC_VER' case 'msvc': return '_MSC_VER'
case 'android': return '__BIONIC__' case 'android': return '__BIONIC__'
case 'js': return '_VJS' case 'js': return '_VJS'
case 'solaris': return '__sun'
} }
verror('bad os ifdef name "$name"') verror('bad os ifdef name "$name"')
return '' return ''
@ -289,6 +290,7 @@ fn platform_postfix_to_ifdefguard(name string) string {
case '_nix.v': return '#ifndef _WIN32' case '_nix.v': return '#ifndef _WIN32'
case '_lin.v': return '#ifdef __linux__' case '_lin.v': return '#ifdef __linux__'
case '_mac.v': return '#ifdef __APPLE__' case '_mac.v': return '#ifdef __APPLE__'
case '_solaris.v': return '#ifdef __sun'
} }
verror('bad platform_postfix "$name"') verror('bad platform_postfix "$name"')
return '' return ''

View File

@ -28,7 +28,7 @@ enum BuildMode {
const ( const (
SupportedPlatforms = ['windows', 'mac', 'linux', 'freebsd', 'openbsd', SupportedPlatforms = ['windows', 'mac', 'linux', 'freebsd', 'openbsd',
'netbsd', 'dragonfly', 'msvc', 'android', 'js'] 'netbsd', 'dragonfly', 'msvc', 'android', 'js', 'solaris']
ModPath = os.home_dir() + '/.vmodules/' ModPath = os.home_dir() + '/.vmodules/'
) )

View File

@ -631,6 +631,8 @@ pub fn executable() string {
// lol // lol
return os.args[0] return os.args[0]
} }
$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 ))
@ -647,7 +649,7 @@ pub fn executable() string {
} }
return string(result, count) return string(result, count)
} }
return '.' return os.args[0]
} }
pub fn is_dir(path string) bool { pub fn is_dir(path string) bool {