mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-26 20:40:28 +00:00
Change support vector to Windows 8+
Doing this makes binaries tinier, since we don't need to have all the
extra code for supporting a 32-bit address space. It also benefits us
because we're able to use WIN32 futexes, which makes locking simpler.
b69f3d2488
is what officially ended our
Windows 7 support. This change is merely a formalization. You can use
old versions of Cosmo now and forevermore if you need Windows 7 since
our repository is hermetic and vendors all its dependencies.
Won't fix #617
This commit is contained in:
parent
6c90f830d9
commit
134ffee519
25 changed files with 296 additions and 167 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/nt/accounting.h"
|
||||
#include "libc/nt/dll.h"
|
||||
#include "libc/nt/struct/systeminfo.h"
|
||||
#include "libc/nt/systeminfo.h"
|
||||
|
@ -61,18 +62,6 @@ static unsigned GetCpuCountBsd(void) {
|
|||
}
|
||||
}
|
||||
|
||||
static textwindows unsigned GetCpuCountWindows(void) {
|
||||
struct NtSystemInfo si;
|
||||
uint32_t (*f)(uint16_t);
|
||||
if ((f = GetProcAddress(GetModuleHandle("KERNEL32"),
|
||||
"GetMaximumProcessorCount"))) {
|
||||
return f(ALL_PROCESSOR_GROUPS);
|
||||
} else {
|
||||
GetSystemInfo(&si);
|
||||
return si.dwNumberOfProcessors;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned GetCpuCountImpl(void) {
|
||||
if (!IsWindows()) {
|
||||
if (!IsBsd()) {
|
||||
|
@ -81,7 +70,7 @@ static unsigned GetCpuCountImpl(void) {
|
|||
return GetCpuCountBsd();
|
||||
}
|
||||
} else {
|
||||
return GetCpuCountWindows();
|
||||
return GetMaximumProcessorCount(ALL_PROCESSOR_GROUPS);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue