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:

committed by
Alexander Medvednikov

parent
751a89ccc8
commit
e577b40743
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user