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

compiler: add support for $if x32, x64, big_endian, little_endian

This commit is contained in:
Delyan Angelov
2019-11-15 15:14:28 +02:00
committed by Alexander Medvednikov
parent 751a89ccc8
commit e577b40743
9 changed files with 144 additions and 22 deletions

View File

@@ -0,0 +1,16 @@
module runtime
fn nr_cpus_nix() int {
$if linux {
return int(C.sysconf(C._SC_NPROCESSORS_ONLN))
}
$if mac {
return int(C.sysconf(C._SC_NPROCESSORS_ONLN))
}
return 1
}
fn nr_cpus_win() int {
eprintln('nr_cpus_win should be callable only for windows')
return 1
}