Initial import

This commit is contained in:
Justine Tunney 2020-06-15 07:18:57 -07:00
commit c91b3c5006
14915 changed files with 590219 additions and 0 deletions

11
libc/nt/thunk/console.inc Normal file
View file

@ -0,0 +1,11 @@
#define GetConsoleMode(...) __imp_GetConsoleMode(__VA_ARGS__)
#define SetConsoleCP(...) __imp_SetConsoleCP(__VA_ARGS__)
#define SetConsoleCtrlHandler(...) __imp_SetConsoleCtrlHandler(__VA_ARGS__)
#define SetConsoleMode(...) __imp_SetConsoleMode(__VA_ARGS__)
#define SetConsoleOutputCP(...) __imp_SetConsoleOutputCP(__VA_ARGS__)
extern typeof(GetConsoleMode) *const __imp_GetConsoleMode __msabi;
extern typeof(SetConsoleCP) *const __imp_SetConsoleCP __msabi;
extern typeof(SetConsoleCtrlHandler) *const __imp_SetConsoleCtrlHandler __msabi;
extern typeof(SetConsoleMode) *const __imp_SetConsoleMode __msabi;
extern typeof(SetConsoleOutputCP) *const __imp_SetConsoleOutputCP __msabi;

3
libc/nt/thunk/files.inc Normal file
View file

@ -0,0 +1,3 @@
#define FlushFileBuffers(...) __imp_FlushFileBuffers(__VA_ARGS__)
extern typeof(FlushFileBuffers) *const __imp_FlushFileBuffers __msabi;

29
libc/nt/thunk/msabi.h Normal file
View 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_ */

3
libc/nt/thunk/ntdll.inc Normal file
View file

@ -0,0 +1,3 @@
#define NtYieldExecution(...) __imp_NtYieldExecution(__VA_ARGS__)
extern typeof(NtYieldExecution) *const __imp_NtYieldExecution __msabi;

4
libc/nt/thunk/ntfile.inc Normal file
View file

@ -0,0 +1,4 @@
#define NtQueryInformationFile(...) __imp_NtQueryInformationFile(__VA_ARGS__)
extern typeof(NtQueryInformationFile) *const
__imp_NtQueryInformationFile __msabi;

View file

@ -0,0 +1,8 @@
#define GetEnvironmentVariable(...) __imp_GetEnvironmentVariableW(__VA_ARGS__)
#define GetPriorityClass(...) __imp_GetPriorityClass(__VA_ARGS__)
#define SetPriorityClass(...) __imp_SetPriorityClass(__VA_ARGS__)
extern typeof(GetEnvironmentVariable) *const
__imp_GetEnvironmentVariableW __msabi;
extern typeof(GetPriorityClass) *const __imp_GetPriorityClass __msabi;
extern typeof(SetPriorityClass) *const __imp_SetPriorityClass __msabi;

23
libc/nt/thunk/runtime.inc Normal file
View file

@ -0,0 +1,23 @@
#define ExitProcess(...) __imp_ExitProcess(__VA_ARGS__)
#define FreeEnvironmentStrings(...) __imp_FreeEnvironmentStringsW(__VA_ARGS__)
#define GetCommandLine(...) __imp_GetCommandLineW(__VA_ARGS__)
#define GetEnvironmentStrings(...) __imp_GetEnvironmentStringsW(__VA_ARGS__)
#define GetStdHandle(...) __imp_GetStdHandle(__VA_ARGS__)
#define SetStdHandle(...) __imp_SetStdHandle(__VA_ARGS__)
#define ReadFile(...) __imp_ReadFile(__VA_ARGS__)
#define WriteFile(...) __imp_WriteFile(__VA_ARGS__)
#define SetDefaultDllDirectories(...) \
__imp_SetDefaultDllDirectories(__VA_ARGS__)
extern typeof(ExitProcess) *const __imp_ExitProcess __msabi;
extern typeof(FreeEnvironmentStrings) *const
__imp_FreeEnvironmentStringsW __msabi;
extern typeof(GetCommandLine) *const __imp_GetCommandLineW __msabi;
extern typeof(GetEnvironmentStrings) *const
__imp_GetEnvironmentStringsW __msabi;
extern typeof(GetStdHandle) *const __imp_GetStdHandle __msabi;
extern typeof(SetStdHandle) *const __imp_SetStdHandle __msabi;
extern typeof(ReadFile) *const __imp_ReadFile __msabi;
extern typeof(WriteFile) *const __imp_WriteFile __msabi;
extern typeof(SetDefaultDllDirectories) *const
__imp_SetDefaultDllDirectories __msabi;

23
libc/nt/thunk/signals.inc Normal file
View file

@ -0,0 +1,23 @@
#define SetErrorMode(...) __imp_SetErrorMode(__VA_ARGS__)
#define AddVectoredExceptionHandler(...) \
__imp_AddVectoredExceptionHandler(__VA_ARGS__)
#define AddVectoredContinueHandler(...) \
__imp_AddVectoredContinueHandler(__VA_ARGS__)
#define RemoveVectoredExceptionHandler(...) \
__imp_RemoveVectoredExceptionHandler(__VA_ARGS__)
#define RemoveVectoredContinueHandler(...) \
__imp_RemoveVectoredContinueHandler(__VA_ARGS__)
#define SetUnhandledExceptionFilter(...) \
__imp_SetUnhandledExceptionFilter(__VA_ARGS__)
extern typeof(SetErrorMode) *const __imp_SetErrorMode __msabi;
extern typeof(AddVectoredExceptionHandler) *const
__imp_AddVectoredExceptionHandler __msabi;
extern typeof(AddVectoredContinueHandler) *const
__imp_AddVectoredContinueHandler __msabi;
extern typeof(RemoveVectoredExceptionHandler) *const
__imp_RemoveVectoredExceptionHandler __msabi;
extern typeof(RemoveVectoredContinueHandler) *const
__imp_RemoveVectoredContinueHandler __msabi;
extern typeof(SetUnhandledExceptionFilter) *const
__imp_SetUnhandledExceptionFilter __msabi;

View file

@ -0,0 +1,3 @@
#define GetStartupInfo(...) __imp_GetStartupInfoW(__VA_ARGS__)
extern typeof(GetStartupInfo) *const __imp_GetStartupInfoW __msabi;

View file

@ -0,0 +1,5 @@
#define GetSystemInfo(...) __imp_GetSystemInfo(__VA_ARGS__)
#define GetTempPath(...) __imp_GetTempPathW(__VA_ARGS__)
extern typeof(GetSystemInfo) *const __imp_GetSystemInfo __msabi;
extern typeof(GetTempPath) *const __imp_GetTempPathW __msabi;

7
libc/nt/thunk/thread.inc Normal file
View file

@ -0,0 +1,7 @@
#define GetCurrentThread(...) __imp_GetCurrentThread(__VA_ARGS__)
#define GetThreadPriority(...) __imp_GetThreadPriority(__VA_ARGS__)
#define SetThreadPriority(...) __imp_SetThreadPriority(__VA_ARGS__)
extern typeof(GetCurrentThread) *const __imp_GetCurrentThread __msabi;
extern typeof(GetThreadPriority) *const __imp_GetThreadPriority __msabi;
extern typeof(SetThreadPriority) *const __imp_SetThreadPriority __msabi;