mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +00:00
22 lines
724 B
C
22 lines
724 B
C
#ifndef COSMOPOLITAN_LIBC_NT_VERSION_H_
|
|
#define COSMOPOLITAN_LIBC_NT_VERSION_H_
|
|
#include "libc/nt/struct/osversioninfo.h"
|
|
COSMOPOLITAN_C_START_
|
|
|
|
bool32 IsAtLeastWindows10(void) pureconst;
|
|
bool32 GetVersionEx(struct NtOsVersionInfo *lpVersionInformation);
|
|
|
|
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && defined(__x86_64__)
|
|
#define IsAtLeastWindows10() (GetNtMajorVersion() >= 10)
|
|
#define GetNtMajorVersion() \
|
|
__extension__({ \
|
|
uintptr_t __x; \
|
|
__asm__("mov\t%%gs:96,%q0\r\n" \
|
|
"mov\t280(%q0),%b0" \
|
|
: "=q"(__x)); \
|
|
(unsigned char)__x; \
|
|
})
|
|
#endif
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* COSMOPOLITAN_LIBC_NT_VERSION_H_ */
|