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

v: add support for _qnx.c.v overriding _default.c.v (#17611)

This commit is contained in:
Thomas Mangin 2023-03-12 17:48:36 +00:00 committed by GitHub
parent 3197ec1a41
commit 0bd094292f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -386,6 +386,9 @@ pub fn user_os() string {
$if solaris { $if solaris {
return 'solaris' return 'solaris'
} }
$if qnx {
return 'qnx'
}
$if haiku { $if haiku {
return 'haiku' return 'haiku'
} }

View File

@ -21,6 +21,7 @@ pub enum OS {
android android
termux // like android, but compiling/running natively on the devices termux // like android, but compiling/running natively on the devices
solaris solaris
qnx
serenity serenity
vinix vinix
haiku haiku
@ -151,6 +152,7 @@ pub fn (o OS) str() string {
.android { return 'Android' } .android { return 'Android' }
.termux { return 'Termux' } .termux { return 'Termux' }
.solaris { return 'Solaris' } .solaris { return 'Solaris' }
.qnx { return 'QNX' }
.serenity { return 'SerenityOS' } .serenity { return 'SerenityOS' }
.vinix { return 'Vinix' } .vinix { return 'Vinix' }
.haiku { return 'Haiku' } .haiku { return 'Haiku' }

View File

@ -204,6 +204,9 @@ pub fn (prefs &Preferences) should_compile_c(file string) bool {
if prefs.os != .solaris && file.ends_with('_solaris.c.v') { if prefs.os != .solaris && file.ends_with('_solaris.c.v') {
return false return false
} }
if prefs.os != .qnx && file.ends_with('_qnx.c.v') {
return false
}
if prefs.os != .serenity && file.ends_with('_serenity.c.v') { if prefs.os != .serenity && file.ends_with('_serenity.c.v') {
return false return false
} }