mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 08:48:29 +00:00
Walk back most uses of __STRICT_ANSI__
This commit is contained in:
parent
7c7bf4bb90
commit
0ef36489c8
11 changed files with 109 additions and 193 deletions
|
@ -1,7 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_TEB_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_TEB_H_
|
||||
#include "libc/nt/struct/peb.h"
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
#ifdef __GNUC__
|
||||
|
||||
/*
|
||||
* These macros address directly into NT's TEB a.k.a. TIB
|
||||
|
@ -21,5 +21,5 @@
|
|||
#define _NtGetRpc() ((void *)*(__seg_gs uintptr_t *)0x50)
|
||||
#define _NtGetTls() ((void *)*(__seg_gs uintptr_t *)0x58)
|
||||
|
||||
#endif /* __GNUC__ && !__STRICT_ANSI__ */
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_TEB_H_ */
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
#define COSMOPOLITAN_LIBC_NT_THUNK_MSABI_H_
|
||||
#ifdef __x86_64__
|
||||
|
||||
#if !defined(__STRICT_ANSI__) && \
|
||||
(__GNUC__ * 100 + __GNUC_MINOR__ >= 408 || \
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__ >= 408 || \
|
||||
(__has_attribute(__ms_abi__) || defined(__llvm__)))
|
||||
/**
|
||||
* Defines function as using Microsoft x64 calling convention.
|
||||
|
|
|
@ -8,13 +8,13 @@ bool32 GetVersionEx(struct NtOsVersionInfo *lpVersionInformation);
|
|||
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && defined(__x86_64__)
|
||||
#define IsAtLeastWindows10() (GetNtMajorVersion() >= 10)
|
||||
#define GetNtMajorVersion() \
|
||||
({ \
|
||||
uintptr_t __x; \
|
||||
asm("mov\t%%gs:96,%q0\r\n" \
|
||||
"mov\t280(%q0),%b0" \
|
||||
: "=q"(__x)); \
|
||||
(unsigned char)__x; \
|
||||
#define GetNtMajorVersion() \
|
||||
__extension__({ \
|
||||
uintptr_t __x; \
|
||||
__asm__("mov\t%%gs:96,%q0\r\n" \
|
||||
"mov\t280(%q0),%b0" \
|
||||
: "=q"(__x)); \
|
||||
(unsigned char)__x; \
|
||||
})
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue