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

compiler: conditional guard for platform specific #includes directives in _xxx.v files.

This commit is contained in:
Delyan Angelov
2019-08-04 21:39:43 +03:00
committed by Alexander Medvednikov
parent 59a4c923c4
commit 0379b9cc69
2 changed files with 35 additions and 1 deletions

View File

@ -164,6 +164,11 @@ fn (p mut Parser) chash() {
}
if hash.starts_with('include') {
if p.first_pass() && !is_sig {
if p.file_pcguard.len != 0 {
//println('p: $p.file_platform $p.file_pcguard')
p.cgen.includes << '$p.file_pcguard\n#$hash\n#endif'
return
}
p.cgen.includes << '#$hash'
return
}