disable $if for headers for now
parent
6db7518189
commit
4cd9099f74
|
@ -31,7 +31,7 @@ fn (p mut Parser) comp_time() {
|
||||||
}
|
}
|
||||||
p.check(.lcbr)
|
p.check(.lcbr)
|
||||||
os := os_from_string(name)
|
os := os_from_string(name)
|
||||||
if p.fileis('runtime.v') && os != p.os {
|
if false && p.fileis('runtime.v') && os != p.os {
|
||||||
// `$if os {` for a different target, skip everything inside
|
// `$if os {` for a different target, skip everything inside
|
||||||
// to avoid compilation errors (like including <windows.h>
|
// to avoid compilation errors (like including <windows.h>
|
||||||
// on non-Windows systems)
|
// on non-Windows systems)
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
module runtime
|
module runtime
|
||||||
|
|
||||||
|
/*
|
||||||
$if linux {
|
$if linux {
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
fn C.get_nprocs() int
|
fn C.get_nprocs() int
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
pub fn nr_cpus() int {
|
pub fn nr_cpus() int {
|
||||||
$if linux {
|
//$if linux {
|
||||||
return C.get_nprocs()
|
//return C.get_nprocs()
|
||||||
}
|
//}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,3 @@
|
||||||
|
|
||||||
module runtime
|
module runtime
|
||||||
|
|
||||||
#include <sys/sysinfo.h>
|
|
||||||
|
|
||||||
fn C.get_nprocs() int
|
|
||||||
|
|
||||||
pub fn nr_cpus() int {
|
|
||||||
return C.get_nprocs()
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue