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

make $if work with includes: skip the body if the target is different

This commit is contained in:
Alexander Medvednikov
2019-10-12 00:54:25 +03:00
parent 9faefe85e1
commit 6db7518189
6 changed files with 64 additions and 29 deletions

View File

@@ -1 +1,14 @@
module runtime
$if linux {
#include <sys/sysinfo.h>
fn C.get_nprocs() int
}
pub fn nr_cpus() int {
$if linux {
return C.get_nprocs()
}
return 0
}