mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 11:18:30 +00:00
parent
a988896048
commit
f317a47cd8
15 changed files with 315 additions and 253 deletions
|
@ -9,13 +9,14 @@ bool32 GetVersionEx(struct NtOsVersionInfo *lpVersionInformation);
|
|||
|
||||
#if defined(__GCC_ASM_FLAG_OUTPUTS__) && !defined(__STRICT_ANSI__)
|
||||
#define IsAtLeastWindows10() (GetNtMajorVersion() >= 10)
|
||||
static pureconst inline unsigned char GetNtMajorVersion(void) {
|
||||
uintptr_t _x;
|
||||
asm("mov\t%%gs:96,%q0\r\n"
|
||||
"mov\t280(%q0),%b0"
|
||||
: "=q"(_x));
|
||||
return _x;
|
||||
}
|
||||
#define GetNtMajorVersion() \
|
||||
({ \
|
||||
uintptr_t __x; \
|
||||
asm("mov\t%%gs:96,%q0\r\n" \
|
||||
"mov\t280(%q0),%b0" \
|
||||
: "=q"(__x)); \
|
||||
(unsigned char)__x; \
|
||||
})
|
||||
#endif
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue