File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ LDFLAGS += -lMacportsLegacySupport
4747VFLAGS += -cc $(CC )
4848VFLAGS += -cflags "$(CFLAGS ) "
4949VFLAGS += -ldflags -L$(LEGACYLIBS ) /lib
50- VFLAGS += -ldflags -lMacportsLegacySupport
50+ VFLAGS += -cflags $( LEGACYLIBS ) /lib/libMacportsLegacySupport.a
5151endif
5252endif
5353
Original file line number Diff line number Diff line change @@ -4,7 +4,12 @@ fn C.sysconf(name i32) i64
44
55// nr_cpus returns the number of virtual CPU cores found on the system.
66pub fn nr_cpus () int {
7- return int (C.sysconf (C._SC_NPROCESSORS_ONLN))
7+ mut cpus := int (C.sysconf (C._SC_NPROCESSORS_ONLN))
8+ if cpus < 1 {
9+ eprintln ('Warning: sysconf(_SC_NPROCESSORS_ONLN) returned -1, returning CPU count as 1' )
10+ cpus = 1
11+ }
12+ return cpus
813}
914
1015// total_memory returns total physical memory found on the system.
You can’t perform that action at this time.
0 commit comments