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

-output-cross-platform-c for creating a single x-platform C file

This commit is contained in:
Alexander Medvednikov
2019-12-04 02:01:17 +03:00
parent a7054b68fd
commit 47f5e1178f
3 changed files with 9 additions and 4 deletions

View File

@ -34,7 +34,9 @@ fn (p mut Parser) comp_time() {
}
p.check(.lcbr)
os := os_from_string(name)
if (!not && os != p.os) || (not && os == p.os) {
if ((!not && os != p.os) || (not && os == p.os)) &&
!p.pref.output_cross_c
{
// `$if os {` for a different target, skip everything inside
// to avoid compilation errors (like including <windows.h>
// on non-Windows systems)