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

all: SerenityOS support (#10702)

This commit is contained in:
pancake 2021-07-09 02:26:43 +02:00 committed by GitHub
parent 13917dc095
commit 151cd0bfe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -559,6 +559,9 @@ fn (mut g Gen) comp_if_to_ifdef(name string, is_comptime_optional bool) ?string
'linux' {
return '__linux__'
}
'serenity' {
return '__serenity__'
}
'freebsd' {
return '__FreeBSD__'
}

View File

@ -16,6 +16,7 @@ pub enum OS {
js // TODO
android
solaris
serenity
haiku
raw
all
@ -34,6 +35,7 @@ pub fn os_from_string(os_str string) ?OS {
'dragonfly' { return .dragonfly }
'js' { return .js }
'solaris' { return .solaris }
'serenity' { return .serenity }
'android' { return .android }
'haiku' { return .haiku }
'raw' { return .raw }
@ -57,6 +59,7 @@ pub fn (o OS) str() string {
.js { return 'JavaScript' }
.android { return 'Android' }
.solaris { return 'Solaris' }
.serenity { return 'serenity' }
.haiku { return 'Haiku' }
.raw { return 'Raw' }
.all { return 'all' }
@ -88,6 +91,13 @@ pub fn get_host_os() OS {
$if dragonfly {
return .dragonfly
}
/*
// TODO: uncomment after regenerating vc.c
$if serenity {
return .serenity
}
*/
$if solaris {
return .solaris
}