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

@ -1 +1,16 @@
module runtime
import os
fn nr_cpus_win() int {
mut nr := int(C.GetCurrentProcessorNumber())
if nr == 0 {
nr = os.getenv('NUMBER_OF_PROCESSORS').int()
}
return nr
}
fn nr_cpus_nix() int {
eprintln('nr_cpus_nix should be callable only for nix platforms')
return 1
}