mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-04 00:40:27 +00:00
Initial import
This commit is contained in:
commit
c91b3c5006
14915 changed files with 590219 additions and 0 deletions
29
libc/nt/thunk/msabi.h
Normal file
29
libc/nt/thunk/msabi.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_NT_THUNK_MSABI_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_THUNK_MSABI_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
/**
|
||||
* Defines function as using Microsoft x64 calling convention.
|
||||
*
|
||||
* This can be used to define prototypes that allow modern compilers to
|
||||
* generate code that calls MS ABI functions directly, without needing
|
||||
* to jump through the assembly thunks.
|
||||
*/
|
||||
#if __GNUC__ * 100 + __GNUC_MINOR_ >= 408 || \
|
||||
(__has_attribute(__ms_abi__) || defined(__llvm__))
|
||||
#define __msabi __attribute__((__ms_abi__))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns true if header should provide MS-ABI overrides.
|
||||
*/
|
||||
#ifndef ShouldUseMsabiAttribute
|
||||
#if defined(__msabi) && defined(NDEBUG) && !defined(__STRICT_ANSI__)
|
||||
#define ShouldUseMsabiAttribute() 1
|
||||
#else
|
||||
#define ShouldUseMsabiAttribute() 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_THUNK_MSABI_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue