├── tcc.exe ├── libtcc.dll ├── lib ├── bcheck.o ├── bt-dll.o ├── bt-exe.o ├── bt-log.o ├── crt1w.c ├── openlibm.o ├── libtcc1-32.a ├── libtcc1-64.a ├── wincrt1w.c ├── dllmain.c ├── psapi.def ├── dllcrt1.c ├── chkstk.S ├── wincrt1.c ├── crt1.c ├── ws2_32.def └── gdi32.def ├── i386-win32-tcc.exe ├── include ├── values.h ├── stdnoreturn.h ├── stdbool.h ├── winapi │ ├── poppack.h │ ├── pshpack1.h │ ├── pshpack2.h │ ├── pshpack4.h │ ├── pshpack8.h │ ├── ws2ipdef.h │ ├── driverspecs.h │ ├── winapifamily.h │ ├── security.h │ ├── rpcnsip.h │ ├── rpcnterr.h │ ├── secext.h │ ├── rpc.h │ ├── qos.h │ ├── basetyps.h │ ├── windows.h │ ├── cguid.h │ ├── servprov.h │ ├── guiddef.h │ ├── winver.h │ ├── basetsd.h │ ├── windef.h │ └── rpcasync.h ├── vadefs.h ├── stdarg.h ├── mem.h ├── varargs.h ├── sys │ ├── unistd.h │ ├── fcntl.h │ ├── file.h │ ├── locking.h │ ├── time.h │ ├── types.h │ ├── timeb.h │ └── utime.h ├── stdalign.h ├── sec_api │ ├── crtdbg_s.h │ ├── sys │ │ └── timeb_s.h │ ├── search_s.h │ ├── stralign_s.h │ ├── io_s.h │ ├── conio_s.h │ ├── string_s.h │ ├── time_s.h │ ├── mbstring_s.h │ ├── stdlib_s.h │ └── wchar_s.h ├── iso646.h ├── share.h ├── dir.h ├── uchar.h ├── dos.h ├── _mingw_unicode.h ├── memory.h ├── fcntl.h ├── float.h ├── errno.h ├── stddef.h ├── signal.h ├── assert.h ├── direct.h ├── locale.h ├── tcc_predefs.h ├── tcclib.h ├── limits.h ├── fenv.h ├── dirent.h ├── excpt.h ├── _mingw.h ├── setjmp.h ├── wctype.h ├── malloc.h ├── tcc │ └── tcc_libm.h ├── stdint.h └── inttypes.h └── libtcc ├── libtcc.def └── libtcc.h /tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/tcc.exe -------------------------------------------------------------------------------- /libtcc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/libtcc.dll -------------------------------------------------------------------------------- /lib/bcheck.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/lib/bcheck.o -------------------------------------------------------------------------------- /lib/bt-dll.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/lib/bt-dll.o -------------------------------------------------------------------------------- /lib/bt-exe.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/lib/bt-exe.o -------------------------------------------------------------------------------- /lib/bt-log.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/lib/bt-log.o -------------------------------------------------------------------------------- /lib/crt1w.c: -------------------------------------------------------------------------------- 1 | #define _UNICODE 1 2 | #define UNICODE 1 3 | #include "crt1.c" 4 | -------------------------------------------------------------------------------- /lib/openlibm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/lib/openlibm.o -------------------------------------------------------------------------------- /i386-win32-tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/i386-win32-tcc.exe -------------------------------------------------------------------------------- /lib/libtcc1-32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/lib/libtcc1-32.a -------------------------------------------------------------------------------- /lib/libtcc1-64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/tccbin_win/HEAD/lib/libtcc1-64.a -------------------------------------------------------------------------------- /lib/wincrt1w.c: -------------------------------------------------------------------------------- 1 | #define _UNICODE 1 2 | #define UNICODE 1 3 | #include "wincrt1.c" 4 | -------------------------------------------------------------------------------- /include/values.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TODO: Nothing here yet. Should provide UNIX compatibility constants 3 | * comparable to those in limits.h and float.h. 4 | */ 5 | -------------------------------------------------------------------------------- /include/stdnoreturn.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDNORETURN_H 2 | #define _STDNORETURN_H 3 | 4 | /* ISOC11 noreturn */ 5 | #define noreturn _Noreturn 6 | 7 | #endif /* _STDNORETURN_H */ 8 | -------------------------------------------------------------------------------- /include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | /* ISOC99 boolean */ 5 | 6 | #define bool _Bool 7 | #define true 1 8 | #define false 0 9 | #define __bool_true_false_are_defined 1 10 | 11 | #endif /* _STDBOOL_H */ 12 | -------------------------------------------------------------------------------- /lib/dllmain.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | 3 | #include 4 | 5 | BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) 6 | { 7 | return TRUE; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /include/winapi/poppack.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(pop) 8 | #endif 9 | -------------------------------------------------------------------------------- /include/winapi/pshpack1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,1) 8 | #endif 9 | -------------------------------------------------------------------------------- /include/winapi/pshpack2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,2) 8 | #endif 9 | -------------------------------------------------------------------------------- /include/winapi/pshpack4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,4) 8 | #endif 9 | -------------------------------------------------------------------------------- /include/winapi/pshpack8.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,8) 8 | #endif 9 | -------------------------------------------------------------------------------- /include/vadefs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_VADEFS 7 | #define _INC_VADEFS 8 | 9 | //!__TINYC__: GNUC specific stuff removed 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /include/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | typedef __builtin_va_list va_list; 5 | #define va_start __builtin_va_start 6 | #define va_arg __builtin_va_arg 7 | #define va_copy __builtin_va_copy 8 | #define va_end __builtin_va_end 9 | 10 | /* fix a buggy dependency on GCC in libio.h */ 11 | typedef va_list __gnuc_va_list; 12 | #define _VA_LIST_DEFINED 13 | 14 | #endif /* _STDARG_H */ 15 | -------------------------------------------------------------------------------- /include/mem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * mem.h maps to string.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /include/varargs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _VARARGS_H 7 | #define _VARARGS_H 8 | 9 | #error "TinyCC no longer implements ." 10 | #error "Revise your code to use ." 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /include/sys/unistd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * unistd.h maps (roughly) to io.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /include/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This fcntl.h maps to the root fcntl.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /include/stdalign.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDALIGN_H 2 | #define _STDALIGN_H 3 | 4 | #if __STDC_VERSION__ < 201112L && (defined(__GNUC__) || defined(__TINYC__)) 5 | # define _Alignas(t) __attribute__((__aligned__(t))) 6 | # define _Alignof(t) __alignof__(t) 7 | #endif 8 | 9 | #define alignas _Alignas 10 | #define alignof _Alignof 11 | 12 | #define __alignas_is_defined 1 13 | #define __alignof_is_defined 1 14 | 15 | #endif /* _STDALIGN_H */ 16 | 17 | -------------------------------------------------------------------------------- /include/sys/file.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This file.h maps to the root fcntl.h 10 | * TODO? 11 | */ 12 | #ifndef __STRICT_ANSI__ 13 | #include 14 | #endif 15 | -------------------------------------------------------------------------------- /include/winapi/ws2ipdef.h: -------------------------------------------------------------------------------- 1 | #ifndef _WS2IPDEF_H 2 | #define _WS2IPDEF_H 3 | 4 | #if __GNUC__ >=3 5 | #pragma GCC system_header 6 | #endif 7 | 8 | #include 9 | 10 | struct ip_mreq { 11 | struct in_addr imr_multiaddr; 12 | struct in_addr imr_interface; 13 | }; 14 | 15 | struct ip_mreq_source { 16 | struct in_addr imr_multiaddr; 17 | struct in_addr imr_sourceaddr; 18 | struct in_addr imr_interface; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /include/winapi/driverspecs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PROJECT: ReactOS DDK 3 | * COPYRIGHT: This file is in the Public Domain. 4 | * FILE: driverspecs.h 5 | * ABSTRACT: This header stubs out Driver Verifier annotations to 6 | * allow drivers using them to compile with our header set. 7 | */ 8 | 9 | /* 10 | * Stubs 11 | */ 12 | #define __drv_dispatchType(x) 13 | #define __drv_dispatchType_other 14 | 15 | #define __drv_aliasesMem 16 | #define __drv_allocatesMem(kind) 17 | #define __drv_freesMem(kind) 18 | -------------------------------------------------------------------------------- /include/sec_api/crtdbg_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _INC_CRTDBG_S 8 | #define _INC_CRTDBG_S 9 | 10 | #include 11 | 12 | #if defined(MINGW_HAS_SECURE_API) 13 | 14 | #define _dupenv_s_dbg(ps1,size,s2,t,f,l) _dupenv_s(ps1,size,s2) 15 | #define _wdupenv_s_dbg(ps1,size,s2,t,f,l) _wdupenv_s(ps1,size,s2) 16 | 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/iso646.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the TinyCC package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | /* 8 | * ISO C Standard: 7.9 Alternative spellings 9 | */ 10 | 11 | #ifndef _ISO646_H_ 12 | #define _ISO646_H_ 13 | 14 | #define and && 15 | #define and_eq &= 16 | #define bitand & 17 | #define bitor | 18 | #define compl ~ 19 | #define not ! 20 | #define not_eq != 21 | #define or || 22 | #define or_eq |= 23 | #define xor ^ 24 | #define xor_eq ^= 25 | 26 | #endif /* _ISO646_H_ */ 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /include/share.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SHARE 7 | #define _INC_SHARE 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #define _SH_COMPAT 0x00 14 | #define _SH_DENYRW 0x10 15 | #define _SH_DENYWR 0x20 16 | #define _SH_DENYRD 0x30 17 | #define _SH_DENYNO 0x40 18 | #define _SH_SECURE 0x80 19 | 20 | #ifndef NO_OLDNAMES 21 | #define SH_COMPAT _SH_COMPAT 22 | #define SH_DENYRW _SH_DENYRW 23 | #define SH_DENYWR _SH_DENYWR 24 | #define SH_DENYRD _SH_DENYRD 25 | #define SH_DENYNO _SH_DENYNO 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/sys/locking.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_LOCKING 7 | #define _INC_LOCKING 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | /* All the headers include this file. */ 14 | #include <_mingw.h> 15 | 16 | #define _LK_UNLCK 0 17 | #define _LK_LOCK 1 18 | #define _LK_NBLCK 2 19 | #define _LK_RLCK 3 20 | #define _LK_NBRLCK 4 21 | 22 | #ifndef NO_OLDNAMES 23 | #define LK_UNLCK _LK_UNLCK 24 | #define LK_LOCK _LK_LOCK 25 | #define LK_NBLCK _LK_NBLCK 26 | #define LK_RLCK _LK_RLCK 27 | #define LK_NBRLCK _LK_NBRLCK 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libtcc/libtcc.def: -------------------------------------------------------------------------------- 1 | LIBRARY libtcc.dll 2 | 3 | EXPORTS 4 | _tcc_error 5 | _tcc_error_noabort 6 | _tcc_warning 7 | tcc_add_file 8 | tcc_add_include_path 9 | tcc_add_library 10 | tcc_add_library_err 11 | tcc_add_library_path 12 | tcc_add_symbol 13 | tcc_add_sysinclude_path 14 | tcc_basename 15 | tcc_compile_string 16 | tcc_define_symbol 17 | tcc_delete 18 | tcc_enter_state 19 | tcc_fileextension 20 | tcc_free 21 | tcc_get_dllexports 22 | tcc_get_error_func 23 | tcc_get_error_opaque 24 | tcc_get_symbol 25 | tcc_list_symbols 26 | tcc_malloc 27 | tcc_mallocz 28 | tcc_new 29 | tcc_output_file 30 | tcc_parse_args 31 | tcc_print_stats 32 | tcc_realloc 33 | tcc_relocate 34 | tcc_run 35 | tcc_set_error_func 36 | tcc_set_lib_path 37 | tcc_set_options 38 | tcc_set_output_type 39 | tcc_strdup 40 | tcc_undefine_symbol 41 | -------------------------------------------------------------------------------- /include/winapi/winapifamily.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the mingw-w64 runtime package. 3 | * No warranty is given; refer to the file DISCLAIMER within this package. 4 | */ 5 | 6 | #ifndef _INC_WINAPIFAMILY 7 | #define _INC_WINAPIFAMILY 8 | 9 | #define WINAPI_PARTITION_DESKTOP 0x1 10 | #define WINAPI_PARTITION_APP 0x2 11 | 12 | #define WINAPI_FAMILY_APP WINAPI_PARTITION_APP 13 | #define WINAPI_FAMILY_DESKTOP_APP (WINAPI_PARTITION_DESKTOP \ 14 | | WINAPI_PARTITION_APP) 15 | 16 | /* WINAPI_FAMILY can be either desktop + App, or App. */ 17 | #ifndef WINAPI_FAMILY 18 | #define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP 19 | #endif 20 | 21 | #define WINAPI_FAMILY_PARTITION(v) ((WINAPI_FAMILY & v) == v) 22 | #define WINAPI_FAMILY_ONE_PARTITION(vset, v) ((WINAPI_FAMILY & vset) == v) 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /lib/psapi.def: -------------------------------------------------------------------------------- 1 | ; 2 | ; Definition file of PSAPI.DLL 3 | ; Automatic generated by gendef 4 | ; written by Kai Tietz 2008 5 | ; 6 | LIBRARY "PSAPI.DLL" 7 | EXPORTS 8 | EmptyWorkingSet 9 | EnumDeviceDrivers 10 | EnumPageFilesA 11 | EnumPageFilesW 12 | EnumProcessModules 13 | EnumProcessModulesEx 14 | EnumProcesses 15 | GetDeviceDriverBaseNameA 16 | GetDeviceDriverBaseNameW 17 | GetDeviceDriverFileNameA 18 | GetDeviceDriverFileNameW 19 | GetMappedFileNameA 20 | GetMappedFileNameW 21 | GetModuleBaseNameA 22 | GetModuleBaseNameW 23 | GetModuleFileNameExA 24 | GetModuleFileNameExW 25 | GetModuleInformation 26 | GetPerformanceInfo 27 | GetProcessImageFileNameA 28 | GetProcessImageFileNameW 29 | GetProcessMemoryInfo 30 | GetWsChanges 31 | GetWsChangesEx 32 | InitializeProcessForWsWatch 33 | QueryWorkingSet 34 | QueryWorkingSetEx 35 | -------------------------------------------------------------------------------- /include/sec_api/sys/timeb_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _TIMEB_H_S 8 | #define _TIMEB_H_S 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #if defined(MINGW_HAS_SECURE_API) 17 | 18 | #ifdef _USE_32BIT_TIME_T 19 | #define _ftime_s _ftime32_s 20 | #else 21 | #define _ftime_s _ftime64_s 22 | #endif 23 | 24 | _CRTIMP errno_t __cdecl _ftime32_s(struct __timeb32 *_Time); 25 | #if _INTEGRAL_MAX_BITS >= 64 26 | _CRTIMP errno_t __cdecl _ftime64_s(struct __timeb64 *_Time); 27 | #endif 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /include/sec_api/search_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SEARCH_S 7 | #define _INC_SEARCH_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP void *__cdecl _lfind_s(const void *_Key,const void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context); 18 | _CRTIMP void *__cdecl _lsearch_s(const void *_Key,void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /include/sec_api/stralign_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __STRALIGN_H_S_ 7 | #define __STRALIGN_H_S_ 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #if !defined(I_X86_) && defined(_WSTRING_S_DEFINED) 18 | #if defined(__cplusplus) && defined(_WConst_Return) 19 | static __inline PUWSTR ua_wcscpy_s(PUWSTR Destination,size_t DestinationSize,PCUWSTR Source) { 20 | if(WSTR_ALIGNED(Source) && WSTR_ALIGNED(Destination)) return (wcscpy_s((PWSTR)Destination,DestinationSize,(PCWSTR)Source)==0 ? Destination : NULL); 21 | return uaw_wcscpy((PCUWSTR)String,Character); 22 | } 23 | #endif 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /include/sec_api/io_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_IO_S 7 | #define _INC_IO_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _access_s(const char *_Filename,int _AccessMode); 18 | _CRTIMP errno_t __cdecl _chsize_s(int _FileHandle,__int64 _Size); 19 | _CRTIMP errno_t __cdecl _mktemp_s(char *_TemplateName,size_t _Size); 20 | _CRTIMP errno_t __cdecl _umask_s(int _NewMode,int *_OldMode); 21 | 22 | #ifndef _WIO_S_DEFINED 23 | #define _WIO_S_DEFINED 24 | _CRTIMP errno_t __cdecl _waccess_s(const wchar_t *_Filename,int _AccessMode); 25 | _CRTIMP errno_t __cdecl _wmktemp_s(wchar_t *_TemplateName,size_t _SizeInWords); 26 | #endif 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /lib/dllcrt1.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | 3 | #include 4 | 5 | extern void (*__init_array_start[]) (void); 6 | extern void (*__init_array_end[]) (void); 7 | extern void (*__fini_array_start[]) (void); 8 | extern void (*__fini_array_end[]) (void); 9 | 10 | BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved); 11 | 12 | BOOL WINAPI _dllstart(HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) 13 | { 14 | BOOL bRet; 15 | int i; 16 | 17 | if (dwReason == DLL_PROCESS_ATTACH) { /* ignore DLL_THREAD_ATTACH */ 18 | i = 0; 19 | while (&__init_array_start[i] != __init_array_end) { 20 | (*__init_array_start[i++])(); 21 | } 22 | } 23 | if (dwReason == DLL_PROCESS_DETACH) { /* ignore DLL_THREAD_DETACH */ 24 | i = 0; 25 | while (&__fini_array_end[i] != __fini_array_start) { 26 | (*__fini_array_end[--i])(); 27 | } 28 | } 29 | bRet = DllMain (hDll, dwReason, lpReserved); 30 | return bRet; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /include/dir.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * dir.h 8 | * 9 | * This file OBSOLESCENT and only provided for backward compatibility. 10 | * Please use io.h instead. 11 | * 12 | * This file is part of the Mingw32 package. 13 | * 14 | * Contributors: 15 | * Created by Colin Peters 16 | * Mumit Khan 17 | * 18 | * THIS SOFTWARE IS NOT COPYRIGHTED 19 | * 20 | * This source code is offered for use in the public domain. You may 21 | * use, modify or distribute it freely. 22 | * 23 | * This code is distributed in the hope that it will be useful but 24 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 25 | * DISCLAIMED. This includes but is not limited to warranties of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 27 | * 28 | */ 29 | 30 | #include 31 | 32 | -------------------------------------------------------------------------------- /include/uchar.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the TinyCC package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _INC_UCHAR 8 | #define _INC_UCHAR 9 | 10 | /* 11 | * The following defines are only valid when C11 (-std=c11) is used. 12 | * 13 | * ... a wide character constant prefixed by the letter u or U has type char16_t 14 | * or char32_t, respectively, unsigned integer types defined in the 15 | * header. 16 | */ 17 | 18 | #if __STDC_VERSION__ >= 201112L 19 | /** 20 | * __STDC_UTF_16__ The integer constant 1, intended to indicate that 21 | * values of type char16_t are UTF-16 encoded. 22 | */ 23 | #define __STDC_UTF_16__ 1 24 | /** 25 | * __STDC_UTF_32__ The integer constant 1, intended to indicate that 26 | * values of type char32_t are UTF-32 encoded. 27 | */ 28 | #define __STDC_UTF_32__ 1 29 | 30 | typedef unsigned short char16_t; 31 | typedef unsigned int char32_t; 32 | #endif /* __STDC_VERSION__ >= 201112L */ 33 | #endif /* _INC_UCHAR */ 34 | -------------------------------------------------------------------------------- /include/winapi/security.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef NTLMSP_NAME_A 7 | #define NTLMSP_NAME_A "NTLM" 8 | #define NTLMSP_NAME L"NTLM" 9 | #endif 10 | 11 | #ifndef MICROSOFT_KERBEROS_NAME_A 12 | #define MICROSOFT_KERBEROS_NAME_A "Kerberos" 13 | #define MICROSOFT_KERBEROS_NAME_W L"Kerberos" 14 | #ifdef WIN32_CHICAGO 15 | #define MICROSOFT_KERBEROS_NAME MICROSOFT_KERBEROS_NAME_A 16 | #else 17 | #define MICROSOFT_KERBEROS_NAME MICROSOFT_KERBEROS_NAME_W 18 | #endif 19 | #endif 20 | 21 | #ifndef NEGOSSP_NAME 22 | #define NEGOSSP_NAME_W L"Negotiate" 23 | #define NEGOSSP_NAME_A "Negotiate" 24 | 25 | #ifdef UNICODE 26 | #define NEGOSSP_NAME NEGOSSP_NAME_W 27 | #else 28 | #define NEGOSSP_NAME NEGOSSP_NAME_A 29 | #endif 30 | #endif 31 | 32 | #include 33 | 34 | #if defined(SECURITY_WIN32) || defined(SECURITY_KERNEL) 35 | #include 36 | #endif 37 | 38 | #if ISSP_LEVEL==16 39 | #include 40 | #endif 41 | -------------------------------------------------------------------------------- /include/winapi/rpcnsip.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __RPCNSIP_H__ 7 | #define __RPCNSIP_H__ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | typedef struct { 14 | RPC_NS_HANDLE LookupContext; 15 | RPC_BINDING_HANDLE ProposedHandle; 16 | RPC_BINDING_VECTOR *Bindings; 17 | } RPC_IMPORT_CONTEXT_P,*PRPC_IMPORT_CONTEXT_P; 18 | 19 | RPCNSAPI RPC_STATUS RPC_ENTRY I_RpcNsGetBuffer(PRPC_MESSAGE Message); 20 | RPCNSAPI RPC_STATUS RPC_ENTRY I_RpcNsSendReceive(PRPC_MESSAGE Message,RPC_BINDING_HANDLE *Handle); 21 | RPCNSAPI void RPC_ENTRY I_RpcNsRaiseException(PRPC_MESSAGE Message,RPC_STATUS Status); 22 | RPCNSAPI RPC_STATUS RPC_ENTRY I_RpcReBindBuffer(PRPC_MESSAGE Message); 23 | RPCNSAPI RPC_STATUS RPC_ENTRY I_NsServerBindSearch(); 24 | RPCNSAPI RPC_STATUS RPC_ENTRY I_NsClientBindSearch(); 25 | RPCNSAPI void RPC_ENTRY I_NsClientBindDone(); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /include/dos.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_DOS 7 | #define _INC_DOS 8 | 9 | #include <_mingw.h> 10 | #include 11 | 12 | #pragma pack(push,_CRT_PACKING) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #ifndef _DISKFREE_T_DEFINED 19 | #define _DISKFREE_T_DEFINED 20 | 21 | struct _diskfree_t { 22 | unsigned total_clusters; 23 | unsigned avail_clusters; 24 | unsigned sectors_per_cluster; 25 | unsigned bytes_per_sector; 26 | }; 27 | #endif 28 | 29 | #define _A_NORMAL 0x00 30 | #define _A_RDONLY 0x01 31 | #define _A_HIDDEN 0x02 32 | #define _A_SYSTEM 0x04 33 | #define _A_SUBDIR 0x10 34 | #define _A_ARCH 0x20 35 | 36 | #ifndef _GETDISKFREE_DEFINED 37 | #define _GETDISKFREE_DEFINED 38 | _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree); 39 | #endif 40 | 41 | #if (defined(_X86_) && !defined(__x86_64)) 42 | void __cdecl _disable(void); 43 | void __cdecl _enable(void); 44 | #endif 45 | 46 | #ifndef NO_OLDNAMES 47 | #define diskfree_t _diskfree_t 48 | #endif 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #pragma pack(pop) 55 | #endif 56 | -------------------------------------------------------------------------------- /include/_mingw_unicode.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the mingw-w64 runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 | */ 6 | 7 | #if !defined(_INC_CRT_UNICODE_MACROS) 8 | /* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */ 9 | 10 | #if defined(UNICODE) 11 | # define _INC_CRT_UNICODE_MACROS 1 12 | # define __MINGW_NAME_AW(func) func##W 13 | # define __MINGW_NAME_AW_EXT(func,ext) func##W##ext 14 | # define __MINGW_NAME_UAW(func) func##_W 15 | # define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext 16 | # define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */ 17 | # define __MINGW_PROCNAMEEXT_AW "W" 18 | #else 19 | # define _INC_CRT_UNICODE_MACROS 2 20 | # define __MINGW_NAME_AW(func) func##A 21 | # define __MINGW_NAME_AW_EXT(func,ext) func##A##ext 22 | # define __MINGW_NAME_UAW(func) func##_A 23 | # define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext 24 | # define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */ 25 | # define __MINGW_PROCNAMEEXT_AW "A" 26 | #endif 27 | 28 | #define __MINGW_TYPEDEF_AW(type) \ 29 | typedef __MINGW_NAME_AW(type) type; 30 | #define __MINGW_TYPEDEF_UAW(type) \ 31 | typedef __MINGW_NAME_UAW(type) type; 32 | 33 | #endif /* !defined(_INC_CRT_UNICODE_MACROS) */ 34 | -------------------------------------------------------------------------------- /include/memory.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_MEMORY 7 | #define _INC_MEMORY 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _CONST_RETURN 16 | #define _CONST_RETURN 17 | #endif 18 | 19 | #define _WConst_return _CONST_RETURN 20 | 21 | #ifndef _CRT_MEMORY_DEFINED 22 | #define _CRT_MEMORY_DEFINED 23 | _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount); 24 | _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount); 25 | _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); 26 | _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale); 27 | int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size); 28 | void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size); 29 | void *__cdecl memset(void *_Dst,int _Val,size_t _Size); 30 | 31 | #ifndef NO_OLDNAMES 32 | void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size); 33 | int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); 34 | #endif 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /include/winapi/rpcnterr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __RPCNTERR_H__ 7 | #define __RPCNTERR_H__ 8 | 9 | #define RPC_S_OK ERROR_SUCCESS 10 | #define RPC_S_INVALID_ARG ERROR_INVALID_PARAMETER 11 | #define RPC_S_OUT_OF_MEMORY ERROR_OUTOFMEMORY 12 | #define RPC_S_OUT_OF_THREADS ERROR_MAX_THRDS_REACHED 13 | #define RPC_S_INVALID_LEVEL ERROR_INVALID_PARAMETER 14 | #define RPC_S_BUFFER_TOO_SMALL ERROR_INSUFFICIENT_BUFFER 15 | #define RPC_S_INVALID_SECURITY_DESC ERROR_INVALID_SECURITY_DESCR 16 | #define RPC_S_ACCESS_DENIED ERROR_ACCESS_DENIED 17 | #define RPC_S_SERVER_OUT_OF_MEMORY ERROR_NOT_ENOUGH_SERVER_MEMORY 18 | #define RPC_S_ASYNC_CALL_PENDING ERROR_IO_PENDING 19 | #define RPC_S_UNKNOWN_PRINCIPAL ERROR_NONE_MAPPED 20 | #define RPC_S_TIMEOUT ERROR_TIMEOUT 21 | 22 | #define RPC_X_NO_MEMORY RPC_S_OUT_OF_MEMORY 23 | #define RPC_X_INVALID_BOUND RPC_S_INVALID_BOUND 24 | #define RPC_X_INVALID_TAG RPC_S_INVALID_TAG 25 | #define RPC_X_ENUM_VALUE_TOO_LARGE RPC_X_ENUM_VALUE_OUT_OF_RANGE 26 | #define RPC_X_SS_CONTEXT_MISMATCH ERROR_INVALID_HANDLE 27 | #define RPC_X_INVALID_BUFFER ERROR_INVALID_USER_BUFFER 28 | #define RPC_X_PIPE_APP_MEMORY ERROR_OUTOFMEMORY 29 | #define RPC_X_INVALID_PIPE_OPERATION RPC_X_WRONG_PIPE_ORDER 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/fcntl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include <_mingw.h> 7 | 8 | #include 9 | 10 | #ifndef _INC_FCNTL 11 | #define _INC_FCNTL 12 | 13 | #define _O_RDONLY 0x0000 14 | #define _O_WRONLY 0x0001 15 | #define _O_RDWR 0x0002 16 | #define _O_APPEND 0x0008 17 | #define _O_CREAT 0x0100 18 | #define _O_TRUNC 0x0200 19 | #define _O_EXCL 0x0400 20 | #define _O_TEXT 0x4000 21 | #define _O_BINARY 0x8000 22 | #define _O_WTEXT 0x10000 23 | #define _O_U16TEXT 0x20000 24 | #define _O_U8TEXT 0x40000 25 | #define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) 26 | 27 | #define _O_RAW _O_BINARY 28 | #define _O_NOINHERIT 0x0080 29 | #define _O_TEMPORARY 0x0040 30 | #define _O_SHORT_LIVED 0x1000 31 | 32 | #define _O_SEQUENTIAL 0x0020 33 | #define _O_RANDOM 0x0010 34 | 35 | #if !defined(NO_OLDNAMES) || defined(_POSIX) 36 | #define O_RDONLY _O_RDONLY 37 | #define O_WRONLY _O_WRONLY 38 | #define O_RDWR _O_RDWR 39 | #define O_APPEND _O_APPEND 40 | #define O_CREAT _O_CREAT 41 | #define O_TRUNC _O_TRUNC 42 | #define O_EXCL _O_EXCL 43 | #define O_TEXT _O_TEXT 44 | #define O_BINARY _O_BINARY 45 | #define O_RAW _O_BINARY 46 | #define O_TEMPORARY _O_TEMPORARY 47 | #define O_NOINHERIT _O_NOINHERIT 48 | #define O_SEQUENTIAL _O_SEQUENTIAL 49 | #define O_RANDOM _O_RANDOM 50 | #define O_ACCMODE _O_ACCMODE 51 | #endif 52 | #endif 53 | -------------------------------------------------------------------------------- /include/float.h: -------------------------------------------------------------------------------- 1 | #ifndef _FLOAT_H_ 2 | #define _FLOAT_H_ 3 | 4 | #define FLT_RADIX 2 5 | 6 | /* IEEE float */ 7 | #define FLT_MANT_DIG 24 8 | #define FLT_DIG 6 9 | #define FLT_ROUNDS 1 10 | #define FLT_EPSILON 1.19209290e-07F 11 | #define FLT_MIN_EXP (-125) 12 | #define FLT_MIN 1.17549435e-38F 13 | #define FLT_MIN_10_EXP (-37) 14 | #define FLT_MAX_EXP 128 15 | #define FLT_MAX 3.40282347e+38F 16 | #define FLT_MAX_10_EXP 38 17 | 18 | /* IEEE double */ 19 | #define DBL_MANT_DIG 53 20 | #define DBL_DIG 15 21 | #define DBL_EPSILON 2.2204460492503131e-16 22 | #define DBL_MIN_EXP (-1021) 23 | #define DBL_MIN 2.2250738585072014e-308 24 | #define DBL_MIN_10_EXP (-307) 25 | #define DBL_MAX_EXP 1024 26 | #define DBL_MAX 1.7976931348623157e+308 27 | #define DBL_MAX_10_EXP 308 28 | 29 | /* horrible intel long double */ 30 | #if defined __i386__ || defined __x86_64__ 31 | 32 | #define LDBL_MANT_DIG 64 33 | #define LDBL_DIG 18 34 | #define LDBL_EPSILON 1.08420217248550443401e-19L 35 | #define LDBL_MIN_EXP (-16381) 36 | #define LDBL_MIN 3.36210314311209350626e-4932L 37 | #define LDBL_MIN_10_EXP (-4931) 38 | #define LDBL_MAX_EXP 16384 39 | #define LDBL_MAX 1.18973149535723176502e+4932L 40 | #define LDBL_MAX_10_EXP 4932 41 | 42 | #else 43 | 44 | /* same as IEEE double */ 45 | #define LDBL_MANT_DIG 53 46 | #define LDBL_DIG 15 47 | #define LDBL_EPSILON 2.2204460492503131e-16 48 | #define LDBL_MIN_EXP (-1021) 49 | #define LDBL_MIN 2.2250738585072014e-308 50 | #define LDBL_MIN_10_EXP (-307) 51 | #define LDBL_MAX_EXP 1024 52 | #define LDBL_MAX 1.7976931348623157e+308 53 | #define LDBL_MAX_10_EXP 308 54 | 55 | #endif 56 | 57 | #endif /* _FLOAT_H_ */ 58 | -------------------------------------------------------------------------------- /include/sec_api/conio_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _INC_CONIO_S 8 | #define _INC_CONIO_S 9 | 10 | #include 11 | 12 | #if defined(MINGW_HAS_SECURE_API) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | _CRTIMP errno_t __cdecl _cgets_s(char *_Buffer,size_t _Size,size_t *_SizeRead); 19 | _CRTIMP int __cdecl _cprintf_s(const char *_Format,...); 20 | _CRTIMP int __cdecl _cscanf_s(const char *_Format,...); 21 | _CRTIMP int __cdecl _cscanf_s_l(const char *_Format,_locale_t _Locale,...); 22 | _CRTIMP int __cdecl _vcprintf_s(const char *_Format,va_list _ArgList); 23 | _CRTIMP int __cdecl _cprintf_s_l(const char *_Format,_locale_t _Locale,...); 24 | _CRTIMP int __cdecl _vcprintf_s_l(const char *_Format,_locale_t _Locale,va_list _ArgList); 25 | 26 | #ifndef _WCONIO_DEFINED_S 27 | #define _WCONIO_DEFINED_S 28 | _CRTIMP errno_t __cdecl _cgetws_s(wchar_t *_Buffer,size_t _SizeInWords,size_t *_SizeRead); 29 | _CRTIMP int __cdecl _cwprintf_s(const wchar_t *_Format,...); 30 | _CRTIMP int __cdecl _cwscanf_s(const wchar_t *_Format,...); 31 | _CRTIMP int __cdecl _cwscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 32 | _CRTIMP int __cdecl _vcwprintf_s(const wchar_t *_Format,va_list _ArgList); 33 | _CRTIMP int __cdecl _cwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 34 | _CRTIMP int __cdecl _vcwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | #endif 43 | -------------------------------------------------------------------------------- /include/errno.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_ERRNO 7 | #define _INC_ERRNO 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _CRT_ERRNO_DEFINED 16 | #define _CRT_ERRNO_DEFINED 17 | _CRTIMP extern int *__cdecl _errno(void); 18 | #define errno (*_errno()) 19 | 20 | errno_t __cdecl _set_errno(int _Value); 21 | errno_t __cdecl _get_errno(int *_Value); 22 | #endif 23 | 24 | #define EPERM 1 25 | #define ENOENT 2 26 | #define ESRCH 3 27 | #define EINTR 4 28 | #define EIO 5 29 | #define ENXIO 6 30 | #define E2BIG 7 31 | #define ENOEXEC 8 32 | #define EBADF 9 33 | #define ECHILD 10 34 | #define EAGAIN 11 35 | #define ENOMEM 12 36 | #define EACCES 13 37 | #define EFAULT 14 38 | #define EBUSY 16 39 | #define EEXIST 17 40 | #define EXDEV 18 41 | #define ENODEV 19 42 | #define ENOTDIR 20 43 | #define EISDIR 21 44 | #define ENFILE 23 45 | #define EMFILE 24 46 | #define ENOTTY 25 47 | #define EFBIG 27 48 | #define ENOSPC 28 49 | #define ESPIPE 29 50 | #define EROFS 30 51 | #define EMLINK 31 52 | #define EPIPE 32 53 | #define EDOM 33 54 | #define EDEADLK 36 55 | #define ENAMETOOLONG 38 56 | #define ENOLCK 39 57 | #define ENOSYS 40 58 | #define ENOTEMPTY 41 59 | 60 | #ifndef RC_INVOKED 61 | #if !defined(_SECURECRT_ERRCODE_VALUES_DEFINED) 62 | #define _SECURECRT_ERRCODE_VALUES_DEFINED 63 | #define EINVAL 22 64 | #define ERANGE 34 65 | #define EILSEQ 42 66 | #define STRUNCATE 80 67 | #endif 68 | #endif 69 | 70 | #define EDEADLOCK EDEADLK 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | #endif 76 | -------------------------------------------------------------------------------- /include/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDDEF_H 2 | #define _STDDEF_H 3 | 4 | typedef __SIZE_TYPE__ size_t; 5 | typedef __PTRDIFF_TYPE__ ssize_t; 6 | typedef __WCHAR_TYPE__ wchar_t; 7 | typedef __PTRDIFF_TYPE__ ptrdiff_t; 8 | typedef __PTRDIFF_TYPE__ intptr_t; 9 | typedef __SIZE_TYPE__ uintptr_t; 10 | 11 | #if __STDC_VERSION__ >= 201112L 12 | typedef union { long long __ll; long double __ld; } max_align_t; 13 | #endif 14 | 15 | #ifndef __int8_t_defined 16 | #define __int8_t_defined 17 | typedef signed char int8_t; 18 | typedef signed short int int16_t; 19 | typedef signed int int32_t; 20 | #ifdef __LP64__ 21 | typedef signed long int int64_t; 22 | #else 23 | typedef signed long long int int64_t; 24 | #endif 25 | typedef unsigned char uint8_t; 26 | typedef unsigned short int uint16_t; 27 | typedef unsigned int uint32_t; 28 | #ifdef __LP64__ 29 | typedef unsigned long int uint64_t; 30 | #else 31 | typedef unsigned long long int uint64_t; 32 | #endif 33 | #endif 34 | 35 | #ifndef NULL 36 | #define NULL ((void*)0) 37 | #endif 38 | 39 | #define offsetof(type, field) ((size_t)&((type *)0)->field) 40 | 41 | void *alloca(size_t size); 42 | 43 | #endif 44 | 45 | /* Older glibc require a wint_t from (when requested 46 | by __need_wint_t, as otherwise stddef.h isn't allowed to 47 | define this type). Note that this must be outside the normal 48 | _STDDEF_H guard, so that it works even when we've included the file 49 | already (without requiring wint_t). Some other libs define _WINT_T 50 | if they've already provided that type, so we can use that as guard. 51 | TCC defines __WINT_TYPE__ for us. */ 52 | #if defined (__need_wint_t) 53 | #ifndef _WINT_T 54 | #define _WINT_T 55 | typedef __WINT_TYPE__ wint_t; 56 | #endif 57 | #undef __need_wint_t 58 | #endif 59 | -------------------------------------------------------------------------------- /include/winapi/secext.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __SECEXT_H__ 7 | #define __SECEXT_H__ 8 | 9 | #include "sspi.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef enum { 16 | NameUnknown = 0,NameFullyQualifiedDN = 1,NameSamCompatible = 2,NameDisplay = 3,NameUniqueId = 6,NameCanonical = 7,NameUserPrincipal = 8, 17 | NameCanonicalEx = 9,NameServicePrincipal = 10,NameDnsDomain = 12 18 | } EXTENDED_NAME_FORMAT,*PEXTENDED_NAME_FORMAT; 19 | 20 | #ifdef UNICODE 21 | #define GetUserNameEx GetUserNameExW 22 | #define GetComputerObjectName GetComputerObjectNameW 23 | #define TranslateName TranslateNameW 24 | #else 25 | #define GetUserNameEx GetUserNameExA 26 | #define GetComputerObjectName GetComputerObjectNameA 27 | #define TranslateName TranslateNameA 28 | #endif 29 | 30 | BOOLEAN SEC_ENTRY GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat,LPSTR lpNameBuffer,PULONG nSize); 31 | BOOLEAN SEC_ENTRY GetUserNameExW(EXTENDED_NAME_FORMAT NameFormat,LPWSTR lpNameBuffer,PULONG nSize); 32 | BOOLEAN SEC_ENTRY GetComputerObjectNameA(EXTENDED_NAME_FORMAT NameFormat,LPSTR lpNameBuffer,PULONG nSize); 33 | BOOLEAN SEC_ENTRY GetComputerObjectNameW(EXTENDED_NAME_FORMAT NameFormat,LPWSTR lpNameBuffer,PULONG nSize); 34 | BOOLEAN SEC_ENTRY TranslateNameA(LPCSTR lpAccountName,EXTENDED_NAME_FORMAT AccountNameFormat,EXTENDED_NAME_FORMAT DesiredNameFormat,LPSTR lpTranslatedName,PULONG nSize); 35 | BOOLEAN SEC_ENTRY TranslateNameW(LPCWSTR lpAccountName,EXTENDED_NAME_FORMAT AccountNameFormat,EXTENDED_NAME_FORMAT DesiredNameFormat,LPWSTR lpTranslatedName,PULONG nSize); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /include/signal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SIGNAL 7 | #define _INC_SIGNAL 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _SIG_ATOMIC_T_DEFINED 16 | #define _SIG_ATOMIC_T_DEFINED 17 | typedef int sig_atomic_t; 18 | #endif 19 | 20 | #define NSIG 23 21 | 22 | #define SIGHUP 1 /* hangup */ 23 | #define SIGINT 2 24 | #define SIGQUIT 3 /* quit */ 25 | #define SIGILL 4 26 | #define SIGTRAP 5 /* trace trap (not reset when caught) */ 27 | #define SIGIOT 6 /* IOT instruction */ 28 | #define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ 29 | #define SIGEMT 7 /* EMT instruction */ 30 | #define SIGFPE 8 31 | #define SIGKILL 9 /* kill (cannot be caught or ignored) */ 32 | #define SIGBUS 10 /* bus error */ 33 | #define SIGSEGV 11 34 | #define SIGSYS 12 /* bad argument to system call */ 35 | #define SIGPIPE 13 /* write on a pipe with no one to read it */ 36 | #ifdef __USE_MINGW_ALARM 37 | #define SIGALRM 14 /* alarm clock */ 38 | #endif 39 | #define SIGTERM 15 40 | #define SIGBREAK 21 41 | #define SIGABRT2 22 42 | 43 | #define SIGABRT_COMPAT 6 44 | 45 | typedef void (*__p_sig_fn_t)(int); 46 | 47 | #define SIG_DFL (__p_sig_fn_t)0 48 | #define SIG_IGN (__p_sig_fn_t)1 49 | #define SIG_GET (__p_sig_fn_t)2 50 | #define SIG_SGE (__p_sig_fn_t)3 51 | #define SIG_ACK (__p_sig_fn_t)4 52 | #define SIG_ERR (__p_sig_fn_t)-1 53 | 54 | extern void **__cdecl __pxcptinfoptrs(void); 55 | #define _pxcptinfoptrs (*__pxcptinfoptrs()) 56 | 57 | __p_sig_fn_t __cdecl signal(int _SigNum,__p_sig_fn_t _Func); 58 | int __cdecl raise(int _SigNum); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #endif 64 | -------------------------------------------------------------------------------- /include/assert.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __ASSERT_H_ 7 | #define __ASSERT_H_ 8 | 9 | #include <_mingw.h> 10 | #ifdef __cplusplus 11 | #include 12 | #endif 13 | 14 | #ifdef NDEBUG 15 | #ifndef assert 16 | #define assert(_Expression) ((void)0) 17 | #endif 18 | #else 19 | 20 | #ifndef _CRT_TERMINATE_DEFINED 21 | #define _CRT_TERMINATE_DEFINED 22 | void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN; 23 | _CRTIMP void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN; 24 | #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ 25 | /* C99 function name */ 26 | void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN; 27 | __CRT_INLINE __MINGW_ATTRIB_NORETURN void __cdecl _Exit(int status) 28 | { _exit(status); } 29 | #endif 30 | 31 | #pragma push_macro("abort") 32 | #undef abort 33 | void __cdecl __declspec(noreturn) abort(void); 34 | #pragma pop_macro("abort") 35 | 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | 43 | extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line); 44 | extern void __cdecl _assert(const char *, const char *, unsigned); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #ifndef assert 51 | //#define assert(_Expression) (void)((!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0)) 52 | #define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__)) 53 | #endif 54 | 55 | #endif 56 | 57 | #if (__STDC_VERSION__ >= 201112L) && !defined(static_assert) 58 | /* C11, section 7.2: The macro static_assert expands to _Static_assert. */ 59 | #define static_assert(exp, str) _Static_assert(exp, str) 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /lib/chkstk.S: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------- */ 2 | /* chkstk86.s */ 3 | 4 | /* ---------------------------------------------- */ 5 | #ifndef __x86_64__ 6 | /* ---------------------------------------------- */ 7 | 8 | .globl __chkstk 9 | 10 | __chkstk: 11 | xchg (%esp),%ebp /* store ebp, get ret.addr */ 12 | push %ebp /* push ret.addr */ 13 | lea 4(%esp),%ebp /* setup frame ptr */ 14 | push %ecx /* save ecx */ 15 | mov %ebp,%ecx 16 | P0: 17 | sub $4096,%ecx 18 | test %eax,(%ecx) 19 | sub $4096,%eax 20 | cmp $4096,%eax 21 | jge P0 22 | sub %eax,%ecx 23 | test %eax,(%ecx) 24 | 25 | mov %esp,%eax 26 | mov %ecx,%esp 27 | mov (%eax),%ecx /* restore ecx */ 28 | jmp *4(%eax) 29 | 30 | /* ---------------------------------------------- */ 31 | #else 32 | /* ---------------------------------------------- */ 33 | 34 | .globl __chkstk 35 | 36 | __chkstk: 37 | xchg (%rsp),%rbp /* store ebp, get ret.addr */ 38 | push %rbp /* push ret.addr */ 39 | lea 8(%rsp),%rbp /* setup frame ptr */ 40 | push %rcx /* save ecx */ 41 | mov %rbp,%rcx 42 | movslq %eax,%rax 43 | P0: 44 | sub $4096,%rcx 45 | test %rax,(%rcx) 46 | sub $4096,%rax 47 | cmp $4096,%rax 48 | jge P0 49 | sub %rax,%rcx 50 | test %rax,(%rcx) 51 | 52 | mov %rsp,%rax 53 | mov %rcx,%rsp 54 | mov (%rax),%rcx /* restore ecx */ 55 | jmp *8(%rax) 56 | 57 | /* ---------------------------------------------- */ 58 | /* setjmp/longjmp support */ 59 | 60 | .globl tinyc_getbp 61 | tinyc_getbp: 62 | mov %rbp,%rax 63 | ret 64 | 65 | /* ---------------------------------------------- */ 66 | #endif 67 | /* ---------------------------------------------- */ 68 | 69 | 70 | -------------------------------------------------------------------------------- /include/sec_api/string_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_STRING_S 7 | #define _INC_STRING_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _strset_s(char *_Dst,size_t _DstSize,int _Value); 18 | _CRTIMP errno_t __cdecl _strerror_s(char *_Buf,size_t _SizeInBytes,const char *_ErrMsg); 19 | _CRTIMP errno_t __cdecl _strlwr_s(char *_Str,size_t _Size); 20 | _CRTIMP errno_t __cdecl _strlwr_s_l(char *_Str,size_t _Size,_locale_t _Locale); 21 | _CRTIMP errno_t __cdecl _strnset_s(char *_Str,size_t _Size,int _Val,size_t _MaxCount); 22 | _CRTIMP errno_t __cdecl _strupr_s(char *_Str,size_t _Size); 23 | _CRTIMP errno_t __cdecl _strupr_s_l(char *_Str,size_t _Size,_locale_t _Locale); 24 | #ifndef _WSTRING_S_DEFINED 25 | #define _WSTRING_S_DEFINED 26 | _CRTIMP wchar_t *__cdecl wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context); 27 | _CRTIMP errno_t __cdecl _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum); 28 | _CRTIMP errno_t __cdecl __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg); 29 | _CRTIMP errno_t __cdecl _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount); 30 | _CRTIMP errno_t __cdecl _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val); 31 | _CRTIMP errno_t __cdecl _wcslwr_s(wchar_t *_Str,size_t _SizeInWords); 32 | _CRTIMP errno_t __cdecl _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale); 33 | _CRTIMP errno_t __cdecl _wcsupr_s(wchar_t *_Str,size_t _Size); 34 | _CRTIMP errno_t __cdecl _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | #endif 42 | -------------------------------------------------------------------------------- /include/sys/time.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _SYS_TIME_H_ 8 | #define _SYS_TIME_H_ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #ifndef __STRICT_ANSI__ 17 | #ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */ 18 | #define _TIMEVAL_DEFINED 19 | struct timeval { 20 | long tv_sec; 21 | long tv_usec; 22 | }; 23 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 24 | #define timercmp(tvp, uvp, cmp) \ 25 | (((tvp)->tv_sec != (uvp)->tv_sec) ? \ 26 | ((tvp)->tv_sec cmp (uvp)->tv_sec) : \ 27 | ((tvp)->tv_usec cmp (uvp)->tv_usec)) 28 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 29 | #endif /* _TIMEVAL_DEFINED */ 30 | 31 | #ifndef _TIMEZONE_DEFINED /* also in sys/time.h */ 32 | #define _TIMEZONE_DEFINED 33 | /* Provided for compatibility with code that assumes that 34 | the presence of gettimeofday function implies a definition 35 | of struct timezone. */ 36 | struct timezone 37 | { 38 | int tz_minuteswest; /* of Greenwich */ 39 | int tz_dsttime; /* type of dst correction to apply */ 40 | }; 41 | 42 | extern int __cdecl mingw_gettimeofday (struct timeval *p, struct timezone *z); 43 | 44 | #endif 45 | 46 | /* 47 | Implementation as per: 48 | The Open Group Base Specifications, Issue 6 49 | IEEE Std 1003.1, 2004 Edition 50 | 51 | The timezone pointer arg is ignored. Errors are ignored. 52 | */ 53 | #ifndef _GETTIMEOFDAY_DEFINED 54 | #define _GETTIMEOFDAY_DEFINED 55 | int __cdecl gettimeofday(struct timeval *__restrict__, 56 | void *__restrict__ /* tzp (unused) */); 57 | #endif 58 | 59 | #endif /* __STRICT_ANSI__ */ 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | /* Adding timespec definition. */ 66 | #include 67 | 68 | 69 | #endif /* _SYS_TIME_H_ */ 70 | -------------------------------------------------------------------------------- /include/winapi/rpc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef RPC_NO_WINDOWS_H 7 | #include 8 | #endif 9 | 10 | #ifndef __RPC_H__ 11 | #define __RPC_H__ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #include 18 | 19 | #if defined(__ia64__) || defined(__x86_64) 20 | #define __RPC_WIN64__ 21 | #else 22 | #define __RPC_WIN32__ 23 | #endif 24 | 25 | #ifdef __RPC_WIN64__ 26 | #include 27 | #endif 28 | 29 | #ifndef __MIDL_USER_DEFINED 30 | #define __MIDL_USER_DEFINED 31 | #define midl_user_allocate MIDL_user_allocate 32 | #define midl_user_free MIDL_user_free 33 | #endif 34 | 35 | typedef void *I_RPC_HANDLE; 36 | typedef long RPC_STATUS; 37 | 38 | #define RPC_UNICODE_SUPPORTED 39 | #define __RPC_FAR 40 | #define __RPC_API __stdcall 41 | #define __RPC_USER __RPC_API 42 | #define __RPC_STUB __RPC_API 43 | #define RPC_ENTRY __RPC_API 44 | 45 | #ifndef DECLSPEC_IMPORT 46 | #define DECLSPEC_IMPORT __declspec(dllimport) 47 | #endif 48 | 49 | #ifndef _RPCRT4_ 50 | #define RPCRTAPI DECLSPEC_IMPORT 51 | #else 52 | #define RPCRTAPI 53 | #endif 54 | 55 | #ifndef _RPCNS4_ 56 | #define RPCNSAPI DECLSPEC_IMPORT 57 | #else 58 | #define RPCNSAPI 59 | #endif 60 | 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | 67 | #define RpcTryExcept __try { 68 | #define RpcExcept(expr) } __except(expr) { 69 | #define RpcEndExcept } 70 | #define RpcTryFinally __try { 71 | #define RpcFinally } __finally { 72 | #define RpcEndFinally } 73 | 74 | #define RpcExceptionCode() GetExceptionCode() 75 | #define RpcAbnormalTermination() AbnormalTermination() 76 | 77 | #ifndef RPC_NO_WINDOWS_H 78 | #include 79 | #endif 80 | 81 | #ifdef __RPC_WIN64__ 82 | #include 83 | #endif 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | #endif 89 | -------------------------------------------------------------------------------- /include/direct.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_DIRECT 7 | #define _INC_DIRECT 8 | 9 | #include <_mingw.h> 10 | #include 11 | 12 | #pragma pack(push,_CRT_PACKING) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #ifndef _DISKFREE_T_DEFINED 19 | #define _DISKFREE_T_DEFINED 20 | struct _diskfree_t { 21 | unsigned total_clusters; 22 | unsigned avail_clusters; 23 | unsigned sectors_per_cluster; 24 | unsigned bytes_per_sector; 25 | }; 26 | #endif 27 | 28 | _CRTIMP char *__cdecl _getcwd(char *_DstBuf,int _SizeInBytes); 29 | _CRTIMP char *__cdecl _getdcwd(int _Drive,char *_DstBuf,int _SizeInBytes); 30 | char *__cdecl _getdcwd_nolock(int _Drive,char *_DstBuf,int _SizeInBytes); 31 | _CRTIMP int __cdecl _chdir(const char *_Path); 32 | _CRTIMP int __cdecl _mkdir(const char *_Path); 33 | _CRTIMP int __cdecl _rmdir(const char *_Path); 34 | _CRTIMP int __cdecl _chdrive(int _Drive); 35 | _CRTIMP int __cdecl _getdrive(void); 36 | _CRTIMP unsigned long __cdecl _getdrives(void); 37 | 38 | #ifndef _GETDISKFREE_DEFINED 39 | #define _GETDISKFREE_DEFINED 40 | _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree); 41 | #endif 42 | 43 | #ifndef _WDIRECT_DEFINED 44 | #define _WDIRECT_DEFINED 45 | _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords); 46 | _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords); 47 | wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords); 48 | _CRTIMP int __cdecl _wchdir(const wchar_t *_Path); 49 | _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path); 50 | _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path); 51 | #endif 52 | 53 | #ifndef NO_OLDNAMES 54 | 55 | #define diskfree_t _diskfree_t 56 | 57 | char *__cdecl getcwd(char *_DstBuf,int _SizeInBytes); 58 | int __cdecl chdir(const char *_Path); 59 | int __cdecl mkdir(const char *_Path); 60 | int __cdecl rmdir(const char *_Path); 61 | #endif 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #pragma pack(pop) 68 | #endif 69 | -------------------------------------------------------------------------------- /include/winapi/qos.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __QOS_H_ 7 | #define __QOS_H_ 8 | 9 | typedef ULONG SERVICETYPE; 10 | 11 | #define SERVICETYPE_NOTRAFFIC 0x00000000 12 | #define SERVICETYPE_BESTEFFORT 0x00000001 13 | #define SERVICETYPE_CONTROLLEDLOAD 0x00000002 14 | #define SERVICETYPE_GUARANTEED 0x00000003 15 | 16 | #define SERVICETYPE_NETWORK_UNAVAILABLE 0x00000004 17 | #define SERVICETYPE_GENERAL_INFORMATION 0x00000005 18 | #define SERVICETYPE_NOCHANGE 0x00000006 19 | #define SERVICETYPE_NONCONFORMING 0x00000009 20 | #define SERVICETYPE_NETWORK_CONTROL 0x0000000A 21 | #define SERVICETYPE_QUALITATIVE 0x0000000D 22 | 23 | #define SERVICE_BESTEFFORT 0x80010000 24 | #define SERVICE_CONTROLLEDLOAD 0x80020000 25 | #define SERVICE_GUARANTEED 0x80040000 26 | #define SERVICE_QUALITATIVE 0x80200000 27 | 28 | #define SERVICE_NO_TRAFFIC_CONTROL 0x81000000 29 | 30 | #define SERVICE_NO_QOS_SIGNALING 0x40000000 31 | 32 | typedef struct _flowspec { 33 | ULONG TokenRate; 34 | ULONG TokenBucketSize; 35 | ULONG PeakBandwidth; 36 | ULONG Latency; 37 | ULONG DelayVariation; 38 | SERVICETYPE ServiceType; 39 | ULONG MaxSduSize; 40 | ULONG MinimumPolicedSize; 41 | } FLOWSPEC,*PFLOWSPEC,*LPFLOWSPEC; 42 | 43 | #define QOS_NOT_SPECIFIED 0xFFFFFFFF 44 | #define POSITIVE_INFINITY_RATE 0xFFFFFFFE 45 | 46 | typedef struct { 47 | ULONG ObjectType; 48 | ULONG ObjectLength; 49 | } QOS_OBJECT_HDR,*LPQOS_OBJECT_HDR; 50 | 51 | #define QOS_GENERAL_ID_BASE 2000 52 | #define QOS_OBJECT_END_OF_LIST (0x00000001 + QOS_GENERAL_ID_BASE) 53 | #define QOS_OBJECT_SD_MODE (0x00000002 + QOS_GENERAL_ID_BASE) 54 | #define QOS_OBJECT_SHAPING_RATE (0x00000003 + QOS_GENERAL_ID_BASE) 55 | #define QOS_OBJECT_DESTADDR (0x00000004 + QOS_GENERAL_ID_BASE) 56 | 57 | typedef struct _QOS_SD_MODE { 58 | QOS_OBJECT_HDR ObjectHdr; 59 | ULONG ShapeDiscardMode; 60 | } QOS_SD_MODE,*LPQOS_SD_MODE; 61 | 62 | #define TC_NONCONF_BORROW 0 63 | #define TC_NONCONF_SHAPE 1 64 | #define TC_NONCONF_DISCARD 2 65 | #define TC_NONCONF_BORROW_PLUS 3 66 | 67 | typedef struct _QOS_SHAPING_RATE { 68 | QOS_OBJECT_HDR ObjectHdr; 69 | ULONG ShapingRate; 70 | } QOS_SHAPING_RATE,*LPQOS_SHAPING_RATE; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /include/locale.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_LOCALE 7 | #define _INC_LOCALE 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifndef NULL 18 | #ifdef __cplusplus 19 | #define NULL 0 20 | #else 21 | #define NULL ((void *)0) 22 | #endif 23 | #endif 24 | 25 | #define LC_ALL 0 26 | #define LC_COLLATE 1 27 | #define LC_CTYPE 2 28 | #define LC_MONETARY 3 29 | #define LC_NUMERIC 4 30 | #define LC_TIME 5 31 | 32 | #define LC_MIN LC_ALL 33 | #define LC_MAX LC_TIME 34 | 35 | #ifndef _LCONV_DEFINED 36 | #define _LCONV_DEFINED 37 | struct lconv { 38 | char *decimal_point; 39 | char *thousands_sep; 40 | char *grouping; 41 | char *int_curr_symbol; 42 | char *currency_symbol; 43 | char *mon_decimal_point; 44 | char *mon_thousands_sep; 45 | char *mon_grouping; 46 | char *positive_sign; 47 | char *negative_sign; 48 | char int_frac_digits; 49 | char frac_digits; 50 | char p_cs_precedes; 51 | char p_sep_by_space; 52 | char n_cs_precedes; 53 | char n_sep_by_space; 54 | char p_sign_posn; 55 | char n_sign_posn; 56 | }; 57 | #endif 58 | 59 | #ifndef _CONFIG_LOCALE_SWT 60 | #define _CONFIG_LOCALE_SWT 61 | 62 | #define _ENABLE_PER_THREAD_LOCALE 0x1 63 | #define _DISABLE_PER_THREAD_LOCALE 0x2 64 | #define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x10 65 | #define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x20 66 | #define _ENABLE_PER_THREAD_LOCALE_NEW 0x100 67 | #define _DISABLE_PER_THREAD_LOCALE_NEW 0x200 68 | 69 | #endif 70 | 71 | int __cdecl _configthreadlocale(int _Flag); 72 | char *__cdecl setlocale(int _Category,const char *_Locale); 73 | _CRTIMP struct lconv *__cdecl localeconv(void); 74 | _locale_t __cdecl _get_current_locale(void); 75 | _locale_t __cdecl _create_locale(int _Category,const char *_Locale); 76 | void __cdecl _free_locale(_locale_t _Locale); 77 | _locale_t __cdecl __get_current_locale(void); 78 | _locale_t __cdecl __create_locale(int _Category,const char *_Locale); 79 | void __cdecl __free_locale(_locale_t _Locale); 80 | 81 | #ifndef _WLOCALE_DEFINED 82 | #define _WLOCALE_DEFINED 83 | _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale); 84 | #endif 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #pragma pack(pop) 91 | #endif 92 | -------------------------------------------------------------------------------- /include/sec_api/time_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _TIME_H__S 7 | #define _TIME_H__S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _ctime32_s(char *_Buf,size_t _SizeInBytes,const __time32_t *_Time); 18 | _CRTIMP errno_t __cdecl _gmtime32_s(struct tm *_Tm,const __time32_t *_Time); 19 | _CRTIMP errno_t __cdecl _localtime32_s(struct tm *_Tm,const __time32_t *_Time); 20 | _CRTIMP errno_t __cdecl _strdate_s(char *_Buf,size_t _SizeInBytes); 21 | _CRTIMP errno_t __cdecl _strtime_s(char *_Buf ,size_t _SizeInBytes); 22 | #if _INTEGRAL_MAX_BITS >= 64 23 | _CRTIMP errno_t __cdecl _ctime64_s(char *_Buf,size_t _SizeInBytes,const __time64_t *_Time); 24 | _CRTIMP errno_t __cdecl _gmtime64_s(struct tm *_Tm,const __time64_t *_Time); 25 | _CRTIMP errno_t __cdecl _localtime64_s(struct tm *_Tm,const __time64_t *_Time); 26 | #endif 27 | 28 | #ifndef _WTIME_S_DEFINED 29 | #define _WTIME_S_DEFINED 30 | _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm); 31 | _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time); 32 | _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords); 33 | _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords); 34 | #if _INTEGRAL_MAX_BITS >= 64 35 | _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time); 36 | #endif 37 | 38 | #if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) 39 | #define _INC_WTIME_S_INL 40 | #ifdef _USE_32BIT_TIME_T 41 | __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s(_Buffer,_SizeInWords,_Time); } 42 | #else 43 | __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer,_SizeInWords,_Time); } 44 | #endif 45 | #endif 46 | #endif 47 | 48 | #ifndef RC_INVOKED 49 | #ifdef _USE_32BIT_TIME_T 50 | __CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime32_s(_Tm,_Time); } 51 | #else 52 | __CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime64_s(_Tm,_Time); } 53 | #endif 54 | #endif 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | #endif 62 | -------------------------------------------------------------------------------- /include/tcc_predefs.h: -------------------------------------------------------------------------------- 1 | #ifdef __x86_64__ 2 | #ifndef _WIN64 3 | 4 | //This should be in sync with the declaration in our lib/libtcc1.c 5 | /* GCC compatible definition of va_list. */ 6 | typedef struct { 7 | unsigned int gp_offset; 8 | unsigned int fp_offset; 9 | union { 10 | unsigned int overflow_offset; 11 | char *overflow_arg_area; 12 | }; 13 | char *reg_save_area; 14 | } __builtin_va_list[1]; 15 | 16 | void *__va_arg(__builtin_va_list ap, int arg_type, int size, int align); 17 | 18 | #define __builtin_va_start(ap, last) \ 19 | (*(ap) = *(__builtin_va_list)((char*)__builtin_frame_address(0) - 24)) 20 | #define __builtin_va_arg(ap, t) \ 21 | (*(t *)(__va_arg(ap, __builtin_va_arg_types(t), sizeof(t), __alignof__(t)))) 22 | #define __builtin_va_copy(dest, src) (*(dest) = *(src)) 23 | 24 | #else /* _WIN64 */ 25 | typedef char *__builtin_va_list; 26 | #define __builtin_va_arg(ap, t) ((sizeof(t) > 8 || (sizeof(t) & (sizeof(t) - 1))) \ 27 | ? **(t **)((ap += 8) - 8) : *(t *)((ap += 8) - 8)) 28 | #endif 29 | 30 | #elif __arm__ 31 | typedef char *__builtin_va_list; 32 | #define _tcc_alignof(type) ((int)&((struct {char c;type x;} *)0)->x) 33 | #define _tcc_align(addr,type) (((unsigned)addr + _tcc_alignof(type) - 1) \ 34 | & ~(_tcc_alignof(type) - 1)) 35 | #define __builtin_va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) 36 | #define __builtin_va_arg(ap,type) (ap = (void *) ((_tcc_align(ap,type)+sizeof(type)+3) \ 37 | &~3), *(type *)(ap - ((sizeof(type)+3)&~3))) 38 | 39 | #elif defined(__aarch64__) 40 | typedef struct { 41 | void *__stack; 42 | void *__gr_top; 43 | void *__vr_top; 44 | int __gr_offs; 45 | int __vr_offs; 46 | } __builtin_va_list; 47 | 48 | #elif defined __riscv 49 | typedef char *__builtin_va_list; 50 | #define __va_reg_size (__riscv_xlen >> 3) 51 | #define _tcc_align(addr,type) (((unsigned long)addr + __alignof__(type) - 1) \ 52 | & -(__alignof__(type))) 53 | #define __builtin_va_arg(ap,type) (*(sizeof(type) > (2*__va_reg_size) ? *(type **)((ap += __va_reg_size) - __va_reg_size) : (ap = (va_list)(_tcc_align(ap,type) + (sizeof(type)+__va_reg_size - 1)& -__va_reg_size), (type *)(ap - ((sizeof(type)+ __va_reg_size - 1)& -__va_reg_size))))) 54 | 55 | #else /* __i386__ */ 56 | typedef char *__builtin_va_list; 57 | #define __builtin_va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) 58 | #define __builtin_va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3))) 59 | #endif 60 | 61 | #ifndef __builtin_va_copy 62 | #define __builtin_va_copy(dest, src) (dest) = (src) 63 | #endif 64 | #define __builtin_va_end(ap) (void)(ap) 65 | -------------------------------------------------------------------------------- /include/sys/types.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_TYPES 7 | #define _INC_TYPES 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | 15 | #ifndef __TINYC__ /* gr */ 16 | #ifdef _USE_32BIT_TIME_T 17 | #ifdef _WIN64 18 | #undef _USE_32BIT_TIME_T 19 | #endif 20 | #else 21 | #if _INTEGRAL_MAX_BITS < 64 22 | #define _USE_32BIT_TIME_T 23 | #endif 24 | #endif 25 | #endif 26 | 27 | #ifndef _TIME32_T_DEFINED 28 | #define _TIME32_T_DEFINED 29 | typedef long __time32_t; 30 | #endif 31 | 32 | #ifndef _TIME64_T_DEFINED 33 | #define _TIME64_T_DEFINED 34 | #if _INTEGRAL_MAX_BITS >= 64 35 | typedef __int64 __time64_t; 36 | #endif 37 | #endif 38 | 39 | #ifndef _TIME_T_DEFINED 40 | #define _TIME_T_DEFINED 41 | #ifdef _USE_32BIT_TIME_T 42 | typedef __time32_t time_t; 43 | #else 44 | typedef __time64_t time_t; 45 | #endif 46 | #endif 47 | 48 | #ifndef _INO_T_DEFINED 49 | #define _INO_T_DEFINED 50 | typedef unsigned short _ino_t; 51 | #ifndef NO_OLDNAMES 52 | typedef unsigned short ino_t; 53 | #endif 54 | #endif 55 | 56 | #ifndef _DEV_T_DEFINED 57 | #define _DEV_T_DEFINED 58 | typedef unsigned int _dev_t; 59 | #ifndef NO_OLDNAMES 60 | typedef unsigned int dev_t; 61 | #endif 62 | #endif 63 | 64 | #ifndef _PID_T_ 65 | #define _PID_T_ 66 | #ifndef _WIN64 67 | typedef int _pid_t; 68 | #else 69 | typedef __int64 _pid_t; 70 | #endif 71 | 72 | #ifndef NO_OLDNAMES 73 | typedef _pid_t pid_t; 74 | #endif 75 | #endif /* Not _PID_T_ */ 76 | 77 | #ifndef _MODE_T_ 78 | #define _MODE_T_ 79 | typedef unsigned short _mode_t; 80 | 81 | #ifndef NO_OLDNAMES 82 | typedef _mode_t mode_t; 83 | #endif 84 | #endif /* Not _MODE_T_ */ 85 | 86 | #ifndef _OFF_T_DEFINED 87 | #define _OFF_T_DEFINED 88 | #ifndef _OFF_T_ 89 | #define _OFF_T_ 90 | typedef long _off_t; 91 | #if !defined(NO_OLDNAMES) || defined(_POSIX) 92 | typedef long off_t; 93 | #endif 94 | #endif 95 | #endif 96 | 97 | #ifndef _OFF64_T_DEFINED 98 | #define _OFF64_T_DEFINED 99 | typedef long long _off64_t; 100 | #if !defined(NO_OLDNAMES) || defined(_POSIX) 101 | typedef long long off64_t; 102 | #endif 103 | #endif 104 | 105 | #ifndef _TIMESPEC_DEFINED 106 | #define _TIMESPEC_DEFINED 107 | struct timespec { 108 | time_t tv_sec; /* Seconds */ 109 | long tv_nsec; /* Nanoseconds */ 110 | }; 111 | 112 | struct itimerspec { 113 | struct timespec it_interval; /* Timer period */ 114 | struct timespec it_value; /* Timer expiration */ 115 | }; 116 | #endif 117 | 118 | #endif 119 | -------------------------------------------------------------------------------- /include/winapi/basetyps.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !defined(_BASETYPS_H_) 7 | #define _BASETYPS_H_ 8 | 9 | #ifdef __cplusplus 10 | #define EXTERN_C extern "C" 11 | #else 12 | #define EXTERN_C extern 13 | #endif 14 | 15 | #define STDMETHODCALLTYPE WINAPI 16 | #define STDMETHODVCALLTYPE __cdecl 17 | 18 | #define STDAPICALLTYPE WINAPI 19 | #define STDAPIVCALLTYPE __cdecl 20 | 21 | #define STDAPI EXTERN_C HRESULT WINAPI 22 | #define STDAPI_(type) EXTERN_C type WINAPI 23 | 24 | #define STDMETHODIMP HRESULT WINAPI 25 | #define STDMETHODIMP_(type) type WINAPI 26 | 27 | #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE 28 | #define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE 29 | 30 | #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE 31 | #define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE 32 | 33 | #if defined(__cplusplus) && !defined(CINTERFACE) 34 | 35 | #define __STRUCT__ struct 36 | #define STDMETHOD(method) virtual HRESULT WINAPI method 37 | #define STDMETHOD_(type,method) virtual type WINAPI method 38 | #define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method 39 | #define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method 40 | #define PURE = 0 41 | #define THIS_ 42 | #define THIS void 43 | #define DECLARE_INTERFACE(iface) __STRUCT__ iface 44 | #define DECLARE_INTERFACE_(iface,baseiface) __STRUCT__ iface : public baseiface 45 | #else 46 | 47 | #ifndef __OBJC__ 48 | #define interface struct 49 | #endif 50 | 51 | #define STDMETHOD(method) HRESULT (WINAPI *method) 52 | #define STDMETHOD_(type,method) type (WINAPI *method) 53 | #define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method) 54 | #define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE *method) 55 | 56 | #define PURE 57 | #define THIS_ INTERFACE *This, 58 | #define THIS INTERFACE *This 59 | #ifdef CONST_VTABLE 60 | #define DECLARE_INTERFACE(iface) typedef struct iface { \ 61 | const struct iface##Vtbl *lpVtbl; } iface; \ 62 | typedef const struct iface##Vtbl iface##Vtbl; \ 63 | const struct iface##Vtbl 64 | #else 65 | #define DECLARE_INTERFACE(iface) typedef struct iface { \ 66 | struct iface##Vtbl *lpVtbl; \ 67 | } iface; \ 68 | typedef struct iface##Vtbl iface##Vtbl; \ 69 | struct iface##Vtbl 70 | #endif 71 | #define DECLARE_INTERFACE_(iface,baseiface) DECLARE_INTERFACE(iface) 72 | #endif 73 | 74 | #include 75 | 76 | #ifndef _ERROR_STATUS_T_DEFINED 77 | #define _ERROR_STATUS_T_DEFINED 78 | typedef unsigned long error_status_t; 79 | #endif 80 | 81 | #ifndef _WCHAR_T_DEFINED 82 | typedef unsigned short wchar_t; 83 | #define _WCHAR_T_DEFINED 84 | #endif 85 | #endif 86 | -------------------------------------------------------------------------------- /include/winapi/windows.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _WINDOWS_ 7 | #define _WINDOWS_ 8 | 9 | #ifndef WIN32_LEAN_AND_MEAN 10 | #define WIN32_LEAN_AND_MEAN 1 11 | #endif 12 | 13 | #ifndef WINVER 14 | #define WINVER 0x0502 15 | #endif 16 | 17 | #include <_mingw.h> 18 | 19 | #ifndef _INC_WINDOWS 20 | #define _INC_WINDOWS 21 | 22 | #if defined(RC_INVOKED) && !defined(NOWINRES) 23 | 24 | #include 25 | #else 26 | 27 | #ifdef RC_INVOKED 28 | #define NOATOM 29 | #define NOGDI 30 | #define NOGDICAPMASKS 31 | #define NOMETAFILE 32 | #define NOMINMAX 33 | #define NOMSG 34 | #define NOOPENFILE 35 | #define NORASTEROPS 36 | #define NOSCROLL 37 | #define NOSOUND 38 | #define NOSYSMETRICS 39 | #define NOTEXTMETRIC 40 | #define NOWH 41 | #define NOCOMM 42 | #define NOKANJI 43 | #define NOCRYPT 44 | #define NOMCX 45 | #endif 46 | 47 | #if !defined(I_X86_) && !defined(_IA64_) && !defined(_AMD64_) && (defined(_X86_) && !defined(__x86_64)) 48 | #define I_X86_ 49 | #endif 50 | 51 | #if !defined(I_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(__x86_64) 52 | #define _AMD64_ 53 | #endif 54 | 55 | #if !defined(I_X86_) && !(defined(_X86_) && !defined(__x86_64)) && !defined(_AMD64_) && defined(__ia64__) 56 | #if !defined(_IA64_) 57 | #define _IA64_ 58 | #endif 59 | #endif 60 | 61 | #ifndef RC_INVOKED 62 | #include 63 | #include 64 | #endif 65 | 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | //gr #include 75 | 76 | #ifndef WIN32_LEAN_AND_MEAN 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | #ifndef NOCRYPT 89 | #include 90 | #include 91 | #include 92 | #endif 93 | 94 | #ifndef NOUSER 95 | #ifndef NOGDI 96 | #include 97 | #ifdef INC_OLE1 98 | #include 99 | #else 100 | #include 101 | #endif 102 | #include 103 | #endif 104 | #endif 105 | #endif 106 | 107 | //gr #include 108 | 109 | #ifdef INC_OLE2 110 | #include 111 | #endif 112 | 113 | #ifndef NOSERVICE 114 | #include 115 | #endif 116 | 117 | #ifndef NOMCX 118 | #include 119 | #endif 120 | 121 | #ifndef NOIME 122 | #include 123 | #endif 124 | 125 | #endif 126 | #endif 127 | #endif 128 | -------------------------------------------------------------------------------- /include/tcclib.h: -------------------------------------------------------------------------------- 1 | /* Simple libc header for TCC 2 | * 3 | * Add any function you want from the libc there. This file is here 4 | * only for your convenience so that you do not need to put the whole 5 | * glibc include files on your floppy disk 6 | */ 7 | #ifndef _TCCLIB_H 8 | #define _TCCLIB_H 9 | 10 | #include 11 | #include 12 | 13 | /* stdlib.h */ 14 | void *calloc(size_t nmemb, size_t size); 15 | void *malloc(size_t size); 16 | void free(void *ptr); 17 | void *realloc(void *ptr, size_t size); 18 | int atoi(const char *nptr); 19 | long int strtol(const char *nptr, char **endptr, int base); 20 | unsigned long int strtoul(const char *nptr, char **endptr, int base); 21 | void exit(int); 22 | 23 | /* stdio.h */ 24 | typedef struct __FILE FILE; 25 | #define EOF (-1) 26 | extern FILE *stdin; 27 | extern FILE *stdout; 28 | extern FILE *stderr; 29 | FILE *fopen(const char *path, const char *mode); 30 | FILE *fdopen(int fildes, const char *mode); 31 | FILE *freopen(const char *path, const char *mode, FILE *stream); 32 | int fclose(FILE *stream); 33 | size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); 34 | size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream); 35 | int fgetc(FILE *stream); 36 | char *fgets(char *s, int size, FILE *stream); 37 | int getc(FILE *stream); 38 | int getchar(void); 39 | char *gets(char *s); 40 | int ungetc(int c, FILE *stream); 41 | int fflush(FILE *stream); 42 | int putchar (int c); 43 | 44 | int printf(const char *format, ...); 45 | int fprintf(FILE *stream, const char *format, ...); 46 | int sprintf(char *str, const char *format, ...); 47 | int snprintf(char *str, size_t size, const char *format, ...); 48 | int asprintf(char **strp, const char *format, ...); 49 | int dprintf(int fd, const char *format, ...); 50 | int vprintf(const char *format, va_list ap); 51 | int vfprintf(FILE *stream, const char *format, va_list ap); 52 | int vsprintf(char *str, const char *format, va_list ap); 53 | int vsnprintf(char *str, size_t size, const char *format, va_list ap); 54 | int vasprintf(char **strp, const char *format, va_list ap); 55 | int vdprintf(int fd, const char *format, va_list ap); 56 | 57 | void perror(const char *s); 58 | 59 | /* string.h */ 60 | char *strcat(char *dest, const char *src); 61 | char *strchr(const char *s, int c); 62 | char *strrchr(const char *s, int c); 63 | char *strcpy(char *dest, const char *src); 64 | void *memcpy(void *dest, const void *src, size_t n); 65 | void *memmove(void *dest, const void *src, size_t n); 66 | void *memset(void *s, int c, size_t n); 67 | char *strdup(const char *s); 68 | size_t strlen(const char *s); 69 | 70 | /* dlfcn.h */ 71 | #define RTLD_LAZY 0x001 72 | #define RTLD_NOW 0x002 73 | #define RTLD_GLOBAL 0x100 74 | 75 | void *dlopen(const char *filename, int flag); 76 | const char *dlerror(void); 77 | void *dlsym(void *handle, char *symbol); 78 | int dlclose(void *handle); 79 | 80 | #endif /* _TCCLIB_H */ 81 | -------------------------------------------------------------------------------- /lib/wincrt1.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | 3 | // _UNICODE for tchar.h, UNICODE for API 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #define __UNKNOWN_APP 0 10 | #define __CONSOLE_APP 1 11 | #define __GUI_APP 2 12 | void __set_app_type(int); 13 | void _controlfp(unsigned a, unsigned b); 14 | 15 | #ifdef _UNICODE 16 | #define __tgetmainargs __wgetmainargs 17 | #define _twinstart _wwinstart 18 | #define _runtwinmain _runwwinmain 19 | int APIENTRY wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int); 20 | #else 21 | #define __tgetmainargs __getmainargs 22 | #define _twinstart _winstart 23 | #define _runtwinmain _runwinmain 24 | #endif 25 | 26 | extern void (*__init_array_start[]) (void); 27 | extern void (*__init_array_end[]) (void); 28 | extern void (*__fini_array_start[]) (void); 29 | extern void (*__fini_array_end[]) (void); 30 | 31 | typedef struct { int newmode; } _startupinfo; 32 | int __cdecl __tgetmainargs(int *pargc, _TCHAR ***pargv, _TCHAR ***penv, int globb, _startupinfo*); 33 | 34 | static int go_winmain(TCHAR *arg1) 35 | { 36 | STARTUPINFO si; 37 | _TCHAR *szCmd, *p; 38 | int fShow; 39 | int retval; 40 | int i; 41 | 42 | GetStartupInfo(&si); 43 | if (si.dwFlags & STARTF_USESHOWWINDOW) 44 | fShow = si.wShowWindow; 45 | else 46 | fShow = SW_SHOWDEFAULT; 47 | 48 | szCmd = NULL, p = GetCommandLine(); 49 | if (arg1) 50 | szCmd = _tcsstr(p, arg1); 51 | if (NULL == szCmd) 52 | szCmd = _tcsdup(__T("")); 53 | else if (szCmd > p && szCmd[-1] == __T('"')) 54 | --szCmd; 55 | #if defined __i386__ || defined __x86_64__ 56 | _controlfp(0x10000, 0x30000); 57 | #endif 58 | i = 0; 59 | while (&__init_array_start[i] != __init_array_end) { 60 | (*__init_array_start[i++])(); 61 | } 62 | retval = _tWinMain(GetModuleHandle(NULL), NULL, szCmd, fShow); 63 | i = 0; 64 | while (&__fini_array_end[i] != __fini_array_start) { 65 | (*__fini_array_end[--i])(); 66 | } 67 | return retval; 68 | } 69 | 70 | static LONG WINAPI catch_sig(EXCEPTION_POINTERS *ex) 71 | { 72 | return _XcptFilter(ex->ExceptionRecord->ExceptionCode, ex); 73 | } 74 | 75 | int _twinstart(void) 76 | { 77 | _startupinfo start_info_con = {0}; 78 | SetUnhandledExceptionFilter(catch_sig); 79 | __set_app_type(__GUI_APP); 80 | __tgetmainargs(&__argc, &__targv, &_tenviron, 0, &start_info_con); 81 | exit(go_winmain(__argc > 1 ? __targv[1] : NULL)); 82 | } 83 | 84 | int _runtwinmain(int argc, /* as tcc passed in */ char **argv) 85 | { 86 | #ifdef UNICODE 87 | _startupinfo start_info = {0}; 88 | __tgetmainargs(&__argc, &__targv, &_tenviron, 0, &start_info); 89 | /* may be wrong when tcc has received wildcards (*.c) */ 90 | if (argc < __argc) 91 | __targv += __argc - argc, __argc = argc; 92 | #else 93 | __argc = argc, __targv = argv; 94 | #endif 95 | return go_winmain(__argc > 1 ? __targv[1] : NULL); 96 | } 97 | -------------------------------------------------------------------------------- /include/sys/timeb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _TIMEB_H_ 7 | #define _TIMEB_H_ 8 | 9 | #include <_mingw.h> 10 | 11 | #ifndef _WIN32 12 | #error Only Win32 target is supported! 13 | #endif 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifndef _CRTIMP 22 | #define _CRTIMP __declspec(dllimport) 23 | #endif 24 | 25 | #ifndef __TINYC__ /* gr */ 26 | #ifdef _USE_32BIT_TIME_T 27 | #ifdef _WIN64 28 | #undef _USE_32BIT_TIME_T 29 | #endif 30 | #else 31 | #if _INTEGRAL_MAX_BITS < 64 32 | #define _USE_32BIT_TIME_T 33 | #endif 34 | #endif 35 | #endif 36 | 37 | #ifndef _TIME32_T_DEFINED 38 | typedef long __time32_t; 39 | #define _TIME32_T_DEFINED 40 | #endif 41 | 42 | #ifndef _TIME64_T_DEFINED 43 | #if _INTEGRAL_MAX_BITS >= 64 44 | typedef __int64 __time64_t; 45 | #endif 46 | #define _TIME64_T_DEFINED 47 | #endif 48 | 49 | #ifndef _TIME_T_DEFINED 50 | #ifdef _USE_32BIT_TIME_T 51 | typedef __time32_t time_t; 52 | #else 53 | typedef __time64_t time_t; 54 | #endif 55 | #define _TIME_T_DEFINED 56 | #endif 57 | 58 | #ifndef _TIMEB_DEFINED 59 | #define _TIMEB_DEFINED 60 | 61 | struct __timeb32 { 62 | __time32_t time; 63 | unsigned short millitm; 64 | short timezone; 65 | short dstflag; 66 | }; 67 | 68 | #ifndef NO_OLDNAMES 69 | struct timeb { 70 | time_t time; 71 | unsigned short millitm; 72 | short timezone; 73 | short dstflag; 74 | }; 75 | #endif 76 | 77 | #if _INTEGRAL_MAX_BITS >= 64 78 | struct __timeb64 { 79 | __time64_t time; 80 | unsigned short millitm; 81 | short timezone; 82 | short dstflag; 83 | }; 84 | #endif 85 | 86 | #ifdef _USE_32BIT_TIME_T 87 | #define _timeb __timeb32 88 | //gr #define _ftime _ftime32 89 | #define _ftime32 _ftime 90 | #else 91 | #define _timeb __timeb64 92 | #define _ftime _ftime64 93 | #endif 94 | #endif 95 | 96 | _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time); 97 | #if _INTEGRAL_MAX_BITS >= 64 98 | _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time); 99 | #endif 100 | 101 | #ifndef _TIMESPEC_DEFINED 102 | #define _TIMESPEC_DEFINED 103 | struct timespec { 104 | time_t tv_sec; /* Seconds */ 105 | long tv_nsec; /* Nanoseconds */ 106 | }; 107 | 108 | struct itimerspec { 109 | struct timespec it_interval; /* Timer period */ 110 | struct timespec it_value; /* Timer expiration */ 111 | }; 112 | #endif 113 | 114 | #if !defined (RC_INVOKED) && !defined (NO_OLDNAMES) 115 | #ifdef _USE_32BIT_TIME_T 116 | __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) { 117 | _ftime32((struct __timeb32 *)_Tmb); 118 | } 119 | #else 120 | __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) { 121 | _ftime64((struct __timeb64 *)_Tmb); 122 | } 123 | #endif 124 | #endif 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #pragma pack(pop) 131 | 132 | #include 133 | #endif 134 | -------------------------------------------------------------------------------- /include/limits.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include <_mingw.h> 7 | 8 | #ifndef _INC_LIMITS 9 | #define _INC_LIMITS 10 | 11 | /* 12 | * File system limits 13 | * 14 | * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the 15 | * same as FILENAME_MAX and FOPEN_MAX from stdio.h? 16 | * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is 17 | * required for the NUL. TODO: Test? 18 | */ 19 | #define PATH_MAX (259) 20 | 21 | #define CHAR_BIT 8 22 | #define SCHAR_MIN (-128) 23 | #define SCHAR_MAX 127 24 | #define UCHAR_MAX 0xff 25 | 26 | #define CHAR_MIN SCHAR_MIN 27 | #define CHAR_MAX SCHAR_MAX 28 | 29 | #define MB_LEN_MAX 5 30 | #define SHRT_MIN (-32768) 31 | #define SHRT_MAX 32767 32 | #define USHRT_MAX 0xffff 33 | #define INT_MIN (-2147483647 - 1) 34 | #define INT_MAX 2147483647 35 | #define UINT_MAX 0xffffffff 36 | #define LONG_MIN (-2147483647L - 1) 37 | #define LONG_MAX 2147483647L 38 | #define ULONG_MAX 0xffffffffUL 39 | #define LLONG_MAX 9223372036854775807ll 40 | #define LLONG_MIN (-9223372036854775807ll - 1) 41 | #define ULLONG_MAX 0xffffffffffffffffull 42 | 43 | #if _INTEGRAL_MAX_BITS >= 8 44 | #define _I8_MIN (-127 - 1) 45 | #define _I8_MAX 127i8 46 | #define _UI8_MAX 0xffu 47 | #endif 48 | 49 | #if _INTEGRAL_MAX_BITS >= 16 50 | #define _I16_MIN (-32767 - 1) 51 | #define _I16_MAX 32767i16 52 | #define _UI16_MAX 0xffffu 53 | #endif 54 | 55 | #if _INTEGRAL_MAX_BITS >= 32 56 | #define _I32_MIN (-2147483647 - 1) 57 | #define _I32_MAX 2147483647 58 | #define _UI32_MAX 0xffffffffu 59 | #endif 60 | 61 | #if defined(__GNUC__) 62 | #undef LONG_LONG_MAX 63 | #define LONG_LONG_MAX 9223372036854775807ll 64 | #undef LONG_LONG_MIN 65 | #define LONG_LONG_MIN (-LONG_LONG_MAX-1) 66 | #undef ULONG_LONG_MAX 67 | #define ULONG_LONG_MAX (2ull * LONG_LONG_MAX + 1ull) 68 | #endif 69 | 70 | #if _INTEGRAL_MAX_BITS >= 64 71 | #define _I64_MIN (-9223372036854775807ll - 1) 72 | #define _I64_MAX 9223372036854775807ll 73 | #define _UI64_MAX 0xffffffffffffffffull 74 | #endif 75 | 76 | #ifndef SIZE_MAX 77 | #ifdef _WIN64 78 | #define SIZE_MAX _UI64_MAX 79 | #else 80 | #define SIZE_MAX UINT_MAX 81 | #endif 82 | #endif 83 | 84 | #ifdef _POSIX_ 85 | #define _POSIX_ARG_MAX 4096 86 | #define _POSIX_CHILD_MAX 6 87 | #define _POSIX_LINK_MAX 8 88 | #define _POSIX_MAX_CANON 255 89 | #define _POSIX_MAX_INPUT 255 90 | #define _POSIX_NAME_MAX 14 91 | #define _POSIX_NGROUPS_MAX 0 92 | #define _POSIX_OPEN_MAX 16 93 | #define _POSIX_PATH_MAX 255 94 | #define _POSIX_PIPE_BUF 512 95 | #define _POSIX_SSIZE_MAX 32767 96 | #define _POSIX_STREAM_MAX 8 97 | #define _POSIX_TZNAME_MAX 3 98 | #define ARG_MAX 14500 99 | #define LINK_MAX 1024 100 | #define MAX_CANON _POSIX_MAX_CANON 101 | #define MAX_INPUT _POSIX_MAX_INPUT 102 | #define NAME_MAX 255 103 | #define NGROUPS_MAX 16 104 | #define OPEN_MAX 32 105 | #define PATH_MAX 512 106 | #define PIPE_BUF _POSIX_PIPE_BUF 107 | #define SSIZE_MAX _POSIX_SSIZE_MAX 108 | #define STREAM_MAX 20 109 | #define TZNAME_MAX 10 110 | #endif 111 | #endif 112 | -------------------------------------------------------------------------------- /lib/crt1.c: -------------------------------------------------------------------------------- 1 | // ============================================= 2 | // crt1.c 3 | 4 | // _UNICODE for tchar.h, UNICODE for API 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _UNKNOWN_APP 0 12 | #define _CONSOLE_APP 1 13 | #define _GUI_APP 2 14 | 15 | #define _MCW_PC 0x00030000 // Precision Control 16 | #define _PC_24 0x00020000 // 24 bits 17 | #define _PC_53 0x00010000 // 53 bits 18 | #define _PC_64 0x00000000 // 64 bits 19 | 20 | #ifdef _UNICODE 21 | #define __tgetmainargs __wgetmainargs 22 | #define _tstart _wstart 23 | #define _tmain wmain 24 | #define _runtmain _runwmain 25 | #else 26 | #define __tgetmainargs __getmainargs 27 | #define _tstart _start 28 | #define _tmain main 29 | #define _runtmain _runmain 30 | #endif 31 | 32 | typedef struct { int newmode; } _startupinfo; 33 | int __cdecl __tgetmainargs(int *pargc, _TCHAR ***pargv, _TCHAR ***penv, int globb, _startupinfo*); 34 | void __cdecl __set_app_type(int apptype); 35 | unsigned int __cdecl _controlfp(unsigned int new_value, unsigned int mask); 36 | extern int _tmain(int argc, _TCHAR * argv[], _TCHAR * env[]); 37 | extern void (*__init_array_start[]) (void); 38 | extern void (*__init_array_end[]) (void); 39 | extern void (*__fini_array_start[]) (void); 40 | extern void (*__fini_array_end[]) (void); 41 | 42 | static int do_main (int argc, _TCHAR * argv[], _TCHAR * env[]) 43 | { 44 | int retval; 45 | long i; 46 | 47 | i = 0; 48 | while (&__init_array_start[i] != __init_array_end) { 49 | (*__init_array_start[i++])(); 50 | } 51 | retval = _tmain(__argc, __targv, _tenviron); 52 | i = 0; 53 | while (&__fini_array_end[i] != __fini_array_start) { 54 | (*__fini_array_end[--i])(); 55 | } 56 | return retval; 57 | } 58 | 59 | /* Allow command-line globbing with "int _dowildcard = 1;" in the user source */ 60 | int _dowildcard; 61 | 62 | static LONG WINAPI catch_sig(EXCEPTION_POINTERS *ex) 63 | { 64 | return _XcptFilter(ex->ExceptionRecord->ExceptionCode, ex); 65 | } 66 | 67 | void _tstart(void) 68 | { 69 | _startupinfo start_info = {0}; 70 | SetUnhandledExceptionFilter(catch_sig); 71 | // Sets the current application type 72 | __set_app_type(_CONSOLE_APP); 73 | 74 | // Set default FP precision to 53 bits (8-byte double) 75 | // _MCW_PC (Precision control) is not supported on ARM 76 | #if defined __i386__ || defined __x86_64__ 77 | _controlfp(_PC_53, _MCW_PC); 78 | #endif 79 | 80 | __tgetmainargs( &__argc, &__targv, &_tenviron, _dowildcard, &start_info); 81 | exit(do_main(__argc, __targv, _tenviron)); 82 | } 83 | 84 | int _runtmain(int argc, /* as tcc passed in */ char **argv) 85 | { 86 | #ifdef UNICODE 87 | _startupinfo start_info = {0}; 88 | 89 | __tgetmainargs(&__argc, &__targv, &_tenviron, _dowildcard, &start_info); 90 | /* may be wrong when tcc has received wildcards (*.c) */ 91 | if (argc < __argc) { 92 | __targv += __argc - argc; 93 | __argc = argc; 94 | } 95 | #else 96 | __argc = argc; 97 | __targv = argv; 98 | #endif 99 | #if defined __i386__ || defined __x86_64__ 100 | _controlfp(_PC_53, _MCW_PC); 101 | #endif 102 | return _tmain(__argc, __targv, _tenviron); 103 | } 104 | 105 | // ============================================= 106 | -------------------------------------------------------------------------------- /include/fenv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _FENV_H_ 7 | #define _FENV_H_ 8 | 9 | #include <_mingw.h> 10 | 11 | /* FPU status word exception flags */ 12 | #define FE_INVALID 0x01 13 | #define FE_DENORMAL 0x02 14 | #define FE_DIVBYZERO 0x04 15 | #define FE_OVERFLOW 0x08 16 | #define FE_UNDERFLOW 0x10 17 | #define FE_INEXACT 0x20 18 | #define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \ 19 | | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) 20 | 21 | /* FPU control word rounding flags */ 22 | #define FE_TONEAREST 0x0000 23 | #define FE_DOWNWARD 0x0400 24 | #define FE_UPWARD 0x0800 25 | #define FE_TOWARDZERO 0x0c00 26 | 27 | /* The MXCSR exception flags are the same as the 28 | FE flags. */ 29 | #define __MXCSR_EXCEPT_FLAG_SHIFT 0 30 | 31 | /* How much to shift FE status word exception flags 32 | to get MXCSR rounding flags, */ 33 | #define __MXCSR_ROUND_FLAG_SHIFT 3 34 | 35 | #ifndef RC_INVOKED 36 | /* 37 | For now, support only for the basic abstraction of flags that are 38 | either set or clear. fexcept_t could be structure that holds more 39 | info about the fp environment. 40 | */ 41 | typedef unsigned short fexcept_t; 42 | 43 | /* This 32-byte struct represents the entire floating point 44 | environment as stored by fnstenv or fstenv, augmented by 45 | the contents of the MXCSR register, as stored by stmxcsr 46 | (if CPU supports it). */ 47 | typedef struct 48 | { 49 | unsigned short __control_word; 50 | unsigned short __unused0; 51 | unsigned short __status_word; 52 | unsigned short __unused1; 53 | unsigned short __tag_word; 54 | unsigned short __unused2; 55 | unsigned int __ip_offset; /* instruction pointer offset */ 56 | unsigned short __ip_selector; 57 | unsigned short __opcode; 58 | unsigned int __data_offset; 59 | unsigned short __data_selector; 60 | unsigned short __unused3; 61 | unsigned int __mxcsr; /* contents of the MXCSR register */ 62 | } fenv_t; 63 | 64 | 65 | /*The C99 standard (7.6.9) allows us to define implementation-specific macros for 66 | different fp environments */ 67 | 68 | /* The default Intel x87 floating point environment (64-bit mantissa) */ 69 | #define FE_PC64_ENV ((const fenv_t *)-1) 70 | 71 | /* The floating point environment set by MSVCRT _fpreset (53-bit mantissa) */ 72 | #define FE_PC53_ENV ((const fenv_t *)-2) 73 | 74 | /* The FE_DFL_ENV macro is required by standard. 75 | fesetenv will use the environment set at app startup.*/ 76 | #define FE_DFL_ENV ((const fenv_t *) 0) 77 | 78 | #ifdef __cplusplus 79 | extern "C" { 80 | #endif 81 | 82 | /*TODO: Some of these could be inlined */ 83 | /* 7.6.2 Exception */ 84 | 85 | extern int __cdecl feclearexcept (int); 86 | extern int __cdecl fegetexceptflag (fexcept_t * flagp, int excepts); 87 | extern int __cdecl feraiseexcept (int excepts ); 88 | extern int __cdecl fesetexceptflag (const fexcept_t *, int); 89 | extern int __cdecl fetestexcept (int excepts); 90 | 91 | /* 7.6.3 Rounding */ 92 | 93 | extern int __cdecl fegetround (void); 94 | extern int __cdecl fesetround (int mode); 95 | 96 | /* 7.6.4 Environment */ 97 | 98 | extern int __cdecl fegetenv(fenv_t * envp); 99 | extern int __cdecl fesetenv(const fenv_t * ); 100 | extern int __cdecl feupdateenv(const fenv_t *); 101 | extern int __cdecl feholdexcept(fenv_t *); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | #endif /* Not RC_INVOKED */ 107 | 108 | #endif /* ndef _FENV_H */ 109 | -------------------------------------------------------------------------------- /include/sec_api/mbstring_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_MBSTRING_S 7 | #define _INC_MBSTRING_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifndef _MBSTRING_S_DEFINED 18 | #define _MBSTRING_S_DEFINED 19 | _CRTIMP errno_t __cdecl _mbscat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); 20 | _CRTIMP errno_t __cdecl _mbscat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); 21 | _CRTIMP errno_t __cdecl _mbscpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); 22 | _CRTIMP errno_t __cdecl _mbscpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); 23 | _CRTIMP errno_t __cdecl _mbslwr_s(unsigned char *_Str,size_t _SizeInBytes); 24 | _CRTIMP errno_t __cdecl _mbslwr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); 25 | _CRTIMP errno_t __cdecl _mbsnbcat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 26 | _CRTIMP errno_t __cdecl _mbsnbcat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 27 | _CRTIMP errno_t __cdecl _mbsnbcpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 28 | _CRTIMP errno_t __cdecl _mbsnbcpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 29 | _CRTIMP errno_t __cdecl _mbsnbset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount); 30 | _CRTIMP errno_t __cdecl _mbsnbset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount,_locale_t _Locale); 31 | _CRTIMP errno_t __cdecl _mbsncat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 32 | _CRTIMP errno_t __cdecl _mbsncat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 33 | _CRTIMP errno_t __cdecl _mbsncpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 34 | _CRTIMP errno_t __cdecl _mbsncpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 35 | _CRTIMP errno_t __cdecl _mbsnset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount); 36 | _CRTIMP errno_t __cdecl _mbsnset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount,_locale_t _Locale); 37 | _CRTIMP errno_t __cdecl _mbsset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val); 38 | _CRTIMP errno_t __cdecl _mbsset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,_locale_t _Locale); 39 | _CRTIMP unsigned char *__cdecl _mbstok_s(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context); 40 | _CRTIMP unsigned char *__cdecl _mbstok_s_l(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context,_locale_t _Locale); 41 | _CRTIMP errno_t __cdecl _mbsupr_s(unsigned char *_Str,size_t _SizeInBytes); 42 | _CRTIMP errno_t __cdecl _mbsupr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); 43 | _CRTIMP errno_t __cdecl _mbccpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src); 44 | _CRTIMP errno_t __cdecl _mbccpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src,_locale_t _Locale); 45 | #endif 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | #endif 53 | -------------------------------------------------------------------------------- /include/winapi/cguid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __CGUID_H__ 7 | #define __CGUID_H__ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | extern const IID GUID_NULL; 14 | extern const IID CATID_MARSHALER; 15 | extern const IID IID_IRpcChannel; 16 | extern const IID IID_IRpcStub; 17 | extern const IID IID_IStubManager; 18 | extern const IID IID_IRpcProxy; 19 | extern const IID IID_IProxyManager; 20 | extern const IID IID_IPSFactory; 21 | extern const IID IID_IInternalMoniker; 22 | extern const IID IID_IDfReserved1; 23 | extern const IID IID_IDfReserved2; 24 | extern const IID IID_IDfReserved3; 25 | extern const CLSID CLSID_StdMarshal; 26 | extern const CLSID CLSID_AggStdMarshal; 27 | extern const CLSID CLSID_StdAsyncActManager; 28 | extern const IID IID_IStub; 29 | extern const IID IID_IProxy; 30 | extern const IID IID_IEnumGeneric; 31 | extern const IID IID_IEnumHolder; 32 | extern const IID IID_IEnumCallback; 33 | extern const IID IID_IOleManager; 34 | extern const IID IID_IOlePresObj; 35 | extern const IID IID_IDebug; 36 | extern const IID IID_IDebugStream; 37 | extern const CLSID CLSID_PSGenObject; 38 | extern const CLSID CLSID_PSClientSite; 39 | extern const CLSID CLSID_PSClassObject; 40 | extern const CLSID CLSID_PSInPlaceActive; 41 | extern const CLSID CLSID_PSInPlaceFrame; 42 | extern const CLSID CLSID_PSDragDrop; 43 | extern const CLSID CLSID_PSBindCtx; 44 | extern const CLSID CLSID_PSEnumerators; 45 | extern const CLSID CLSID_StaticMetafile; 46 | extern const CLSID CLSID_StaticDib; 47 | extern const CLSID CID_CDfsVolume; 48 | extern const CLSID CLSID_DCOMAccessControl; 49 | extern const CLSID CLSID_StdGlobalInterfaceTable; 50 | extern const CLSID CLSID_ComBinding; 51 | extern const CLSID CLSID_StdEvent; 52 | extern const CLSID CLSID_ManualResetEvent; 53 | extern const CLSID CLSID_SynchronizeContainer; 54 | extern const CLSID CLSID_AddrControl; 55 | extern const CLSID CLSID_CCDFormKrnl; 56 | extern const CLSID CLSID_CCDPropertyPage; 57 | extern const CLSID CLSID_CCDFormDialog; 58 | extern const CLSID CLSID_CCDCommandButton; 59 | extern const CLSID CLSID_CCDComboBox; 60 | extern const CLSID CLSID_CCDTextBox; 61 | extern const CLSID CLSID_CCDCheckBox; 62 | extern const CLSID CLSID_CCDLabel; 63 | extern const CLSID CLSID_CCDOptionButton; 64 | extern const CLSID CLSID_CCDListBox; 65 | extern const CLSID CLSID_CCDScrollBar; 66 | extern const CLSID CLSID_CCDGroupBox; 67 | extern const CLSID CLSID_CCDGeneralPropertyPage; 68 | extern const CLSID CLSID_CCDGenericPropertyPage; 69 | extern const CLSID CLSID_CCDFontPropertyPage; 70 | extern const CLSID CLSID_CCDColorPropertyPage; 71 | extern const CLSID CLSID_CCDLabelPropertyPage; 72 | extern const CLSID CLSID_CCDCheckBoxPropertyPage; 73 | extern const CLSID CLSID_CCDTextBoxPropertyPage; 74 | extern const CLSID CLSID_CCDOptionButtonPropertyPage; 75 | extern const CLSID CLSID_CCDListBoxPropertyPage; 76 | extern const CLSID CLSID_CCDCommandButtonPropertyPage; 77 | extern const CLSID CLSID_CCDComboBoxPropertyPage; 78 | extern const CLSID CLSID_CCDScrollBarPropertyPage; 79 | extern const CLSID CLSID_CCDGroupBoxPropertyPage; 80 | extern const CLSID CLSID_CCDXObjectPropertyPage; 81 | extern const CLSID CLSID_CStdPropertyFrame; 82 | extern const CLSID CLSID_CFormPropertyPage; 83 | extern const CLSID CLSID_CGridPropertyPage; 84 | extern const CLSID CLSID_CWSJArticlePage; 85 | extern const CLSID CLSID_CSystemPage; 86 | extern const CLSID CLSID_IdentityUnmarshal; 87 | extern const CLSID CLSID_InProcFreeMarshaler; 88 | extern const CLSID CLSID_Picture_Metafile; 89 | extern const CLSID CLSID_Picture_EnhMetafile; 90 | extern const CLSID CLSID_Picture_Dib; 91 | extern const GUID GUID_TRISTATE; 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | #endif 97 | -------------------------------------------------------------------------------- /include/dirent.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* All the headers include this file. */ 7 | #include <_mingw.h> 8 | 9 | #ifndef __STRICT_ANSI__ 10 | 11 | #ifndef _DIRENT_H_ 12 | #define _DIRENT_H_ 13 | 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #include 18 | 19 | #ifndef RC_INVOKED 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | struct dirent 26 | { 27 | long d_ino; /* Always zero. */ 28 | unsigned short d_reclen; /* Always zero. */ 29 | unsigned short d_namlen; /* Length of name in d_name. */ 30 | char* d_name; /* File name. */ 31 | /* NOTE: The name in the dirent structure points to the name in the 32 | * finddata_t structure in the DIR. */ 33 | }; 34 | 35 | /* 36 | * This is an internal data structure. Good programmers will not use it 37 | * except as an argument to one of the functions below. 38 | * dd_stat field is now int (was short in older versions). 39 | */ 40 | typedef struct 41 | { 42 | /* disk transfer area for this dir */ 43 | struct _finddata_t dd_dta; 44 | 45 | /* dirent struct to return from dir (NOTE: this makes this thread 46 | * safe as long as only one thread uses a particular DIR struct at 47 | * a time) */ 48 | struct dirent dd_dir; 49 | 50 | /* _findnext handle */ 51 | long dd_handle; 52 | 53 | /* 54 | * Status of search: 55 | * 0 = not started yet (next entry to read is first entry) 56 | * -1 = off the end 57 | * positive = 0 based index of next entry 58 | */ 59 | int dd_stat; 60 | 61 | /* given path for dir with search pattern (struct is extended) */ 62 | char dd_name[1]; 63 | } DIR; 64 | 65 | DIR* __cdecl opendir (const char*); 66 | struct dirent* __cdecl readdir (DIR*); 67 | int __cdecl closedir (DIR*); 68 | void __cdecl rewinddir (DIR*); 69 | long __cdecl telldir (DIR*); 70 | void __cdecl seekdir (DIR*, long); 71 | 72 | 73 | /* wide char versions */ 74 | 75 | struct _wdirent 76 | { 77 | long d_ino; /* Always zero. */ 78 | unsigned short d_reclen; /* Always zero. */ 79 | unsigned short d_namlen; /* Length of name in d_name. */ 80 | wchar_t* d_name; /* File name. */ 81 | /* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */ 82 | }; 83 | 84 | /* 85 | * This is an internal data structure. Good programmers will not use it 86 | * except as an argument to one of the functions below. 87 | */ 88 | typedef struct 89 | { 90 | /* disk transfer area for this dir */ 91 | struct _wfinddata_t dd_dta; 92 | 93 | /* dirent struct to return from dir (NOTE: this makes this thread 94 | * safe as long as only one thread uses a particular DIR struct at 95 | * a time) */ 96 | struct _wdirent dd_dir; 97 | 98 | /* _findnext handle */ 99 | long dd_handle; 100 | 101 | /* 102 | * Status of search: 103 | * 0 = not started yet (next entry to read is first entry) 104 | * -1 = off the end 105 | * positive = 0 based index of next entry 106 | */ 107 | int dd_stat; 108 | 109 | /* given path for dir with search pattern (struct is extended) */ 110 | wchar_t dd_name[1]; 111 | } _WDIR; 112 | 113 | 114 | 115 | _WDIR* __cdecl _wopendir (const wchar_t*); 116 | struct _wdirent* __cdecl _wreaddir (_WDIR*); 117 | int __cdecl _wclosedir (_WDIR*); 118 | void __cdecl _wrewinddir (_WDIR*); 119 | long __cdecl _wtelldir (_WDIR*); 120 | void __cdecl _wseekdir (_WDIR*, long); 121 | 122 | 123 | #ifdef __cplusplus 124 | } 125 | #endif 126 | 127 | #endif /* Not RC_INVOKED */ 128 | 129 | #pragma pack(pop) 130 | 131 | #endif /* Not _DIRENT_H_ */ 132 | 133 | 134 | #endif /* Not __STRICT_ANSI__ */ 135 | 136 | -------------------------------------------------------------------------------- /include/sys/utime.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_UTIME 7 | #define _INC_UTIME 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifndef _CRTIMP 22 | #define _CRTIMP __declspec(dllimport) 23 | #endif 24 | 25 | #ifndef _WCHAR_T_DEFINED 26 | typedef unsigned short wchar_t; 27 | #define _WCHAR_T_DEFINED 28 | #endif 29 | 30 | #ifndef __TINYC__ /* gr */ 31 | #ifdef _USE_32BIT_TIME_T 32 | #ifdef _WIN64 33 | #undef _USE_32BIT_TIME_T 34 | #endif 35 | #else 36 | #if _INTEGRAL_MAX_BITS < 64 37 | #define _USE_32BIT_TIME_T 38 | #endif 39 | #endif 40 | #endif 41 | 42 | #ifndef _TIME32_T_DEFINED 43 | #define _TIME32_T_DEFINED 44 | typedef long __time32_t; 45 | #endif 46 | 47 | #ifndef _TIME64_T_DEFINED 48 | #define _TIME64_T_DEFINED 49 | #if _INTEGRAL_MAX_BITS >= 64 50 | typedef __int64 __time64_t; 51 | #endif 52 | #endif 53 | 54 | #ifndef _TIME_T_DEFINED 55 | #define _TIME_T_DEFINED 56 | #ifdef _USE_32BIT_TIME_T 57 | typedef __time32_t time_t; 58 | #else 59 | typedef __time64_t time_t; 60 | #endif 61 | #endif 62 | 63 | #ifndef _UTIMBUF_DEFINED 64 | #define _UTIMBUF_DEFINED 65 | 66 | struct _utimbuf { 67 | time_t actime; 68 | time_t modtime; 69 | }; 70 | 71 | struct __utimbuf32 { 72 | __time32_t actime; 73 | __time32_t modtime; 74 | }; 75 | 76 | #if _INTEGRAL_MAX_BITS >= 64 77 | struct __utimbuf64 { 78 | __time64_t actime; 79 | __time64_t modtime; 80 | }; 81 | #endif 82 | 83 | #ifndef NO_OLDNAMES 84 | struct utimbuf { 85 | time_t actime; 86 | time_t modtime; 87 | }; 88 | 89 | struct utimbuf32 { 90 | __time32_t actime; 91 | __time32_t modtime; 92 | }; 93 | #endif 94 | #endif 95 | 96 | _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time); 97 | _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time); 98 | _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time); 99 | #if _INTEGRAL_MAX_BITS >= 64 100 | _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time); 101 | _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time); 102 | _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time); 103 | #endif 104 | 105 | #ifndef RC_INVOKED 106 | #ifdef _USE_32BIT_TIME_T 107 | __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { 108 | return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); 109 | } 110 | __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { 111 | return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf); 112 | } 113 | __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { 114 | return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf); 115 | } 116 | #else 117 | __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { 118 | return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); 119 | } 120 | __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { 121 | return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf); 122 | } 123 | __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { 124 | return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf); 125 | } 126 | #endif 127 | 128 | #ifndef NO_OLDNAMES 129 | #ifdef _USE_32BIT_TIME_T 130 | __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) { 131 | return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); 132 | } 133 | #else 134 | __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) { 135 | return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); 136 | } 137 | #endif 138 | #endif 139 | #endif 140 | 141 | #ifdef __cplusplus 142 | } 143 | #endif 144 | 145 | #pragma pack(pop) 146 | #endif 147 | -------------------------------------------------------------------------------- /libtcc/libtcc.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTCC_H 2 | #define LIBTCC_H 3 | 4 | #ifndef LIBTCCAPI 5 | # define LIBTCCAPI 6 | #endif 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | struct TCCState; 13 | 14 | typedef struct TCCState TCCState; 15 | 16 | typedef void (*TCCErrorFunc)(void *opaque, const char *msg); 17 | 18 | /* create a new TCC compilation context */ 19 | LIBTCCAPI TCCState *tcc_new(void); 20 | 21 | /* free a TCC compilation context */ 22 | LIBTCCAPI void tcc_delete(TCCState *s); 23 | 24 | /* set CONFIG_TCCDIR at runtime */ 25 | LIBTCCAPI void tcc_set_lib_path(TCCState *s, const char *path); 26 | 27 | /* set error/warning display callback */ 28 | LIBTCCAPI void tcc_set_error_func(TCCState *s, void *error_opaque, TCCErrorFunc error_func); 29 | 30 | /* return error/warning callback */ 31 | LIBTCCAPI TCCErrorFunc tcc_get_error_func(TCCState *s); 32 | 33 | /* return error/warning callback opaque pointer */ 34 | LIBTCCAPI void *tcc_get_error_opaque(TCCState *s); 35 | 36 | /* set options as from command line (multiple supported) */ 37 | LIBTCCAPI void tcc_set_options(TCCState *s, const char *str); 38 | 39 | /*****************************/ 40 | /* preprocessor */ 41 | 42 | /* add include path */ 43 | LIBTCCAPI int tcc_add_include_path(TCCState *s, const char *pathname); 44 | 45 | /* add in system include path */ 46 | LIBTCCAPI int tcc_add_sysinclude_path(TCCState *s, const char *pathname); 47 | 48 | /* define preprocessor symbol 'sym'. Can put optional value */ 49 | LIBTCCAPI void tcc_define_symbol(TCCState *s, const char *sym, const char *value); 50 | 51 | /* undefine preprocess symbol 'sym' */ 52 | LIBTCCAPI void tcc_undefine_symbol(TCCState *s, const char *sym); 53 | 54 | /*****************************/ 55 | /* compiling */ 56 | 57 | /* add a file (C file, dll, object, library, ld script). Return -1 if error. */ 58 | LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename); 59 | 60 | /* compile a string containing a C source. Return -1 if error. */ 61 | LIBTCCAPI int tcc_compile_string(TCCState *s, const char *buf); 62 | 63 | /*****************************/ 64 | /* linking commands */ 65 | 66 | /* set output type. MUST BE CALLED before any compilation */ 67 | LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type); 68 | #define TCC_OUTPUT_MEMORY 1 /* output will be run in memory (default) */ 69 | #define TCC_OUTPUT_EXE 2 /* executable file */ 70 | #define TCC_OUTPUT_DLL 3 /* dynamic library */ 71 | #define TCC_OUTPUT_OBJ 4 /* object file */ 72 | #define TCC_OUTPUT_PREPROCESS 5 /* only preprocess (used internally) */ 73 | 74 | /* equivalent to -Lpath option */ 75 | LIBTCCAPI int tcc_add_library_path(TCCState *s, const char *pathname); 76 | 77 | /* the library name is the same as the argument of the '-l' option */ 78 | LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname); 79 | 80 | /* add a symbol to the compiled program */ 81 | LIBTCCAPI int tcc_add_symbol(TCCState *s, const char *name, const void *val); 82 | 83 | /* output an executable, library or object file. DO NOT call 84 | tcc_relocate() before. */ 85 | LIBTCCAPI int tcc_output_file(TCCState *s, const char *filename); 86 | 87 | /* link and run main() function and return its value. DO NOT call 88 | tcc_relocate() before. */ 89 | LIBTCCAPI int tcc_run(TCCState *s, int argc, char **argv); 90 | 91 | /* do all relocations (needed before using tcc_get_symbol()) */ 92 | LIBTCCAPI int tcc_relocate(TCCState *s1, void *ptr); 93 | /* possible values for 'ptr': 94 | - TCC_RELOCATE_AUTO : Allocate and manage memory internally 95 | - NULL : return required memory size for the step below 96 | - memory address : copy code to memory passed by the caller 97 | returns -1 if error. */ 98 | #define TCC_RELOCATE_AUTO (void*)1 99 | 100 | /* return symbol value or NULL if not found */ 101 | LIBTCCAPI void *tcc_get_symbol(TCCState *s, const char *name); 102 | 103 | /* return symbol value or NULL if not found */ 104 | LIBTCCAPI void tcc_list_symbols(TCCState *s, void *ctx, 105 | void (*symbol_cb)(void *ctx, const char *name, const void *val)); 106 | 107 | #ifdef __cplusplus 108 | } 109 | #endif 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /include/sec_api/stdlib_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_STDLIB_S 7 | #define _INC_STDLIB_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _dupenv_s(char **_PBuffer,size_t *_PBufferSizeInBytes,const char *_VarName); 18 | _CRTIMP errno_t __cdecl _itoa_s(int _Value,char *_DstBuf,size_t _Size,int _Radix); 19 | #if _INTEGRAL_MAX_BITS >= 64 20 | _CRTIMP errno_t __cdecl _i64toa_s(__int64 _Val,char *_DstBuf,size_t _Size,int _Radix); 21 | _CRTIMP errno_t __cdecl _ui64toa_s(unsigned __int64 _Val,char *_DstBuf,size_t _Size,int _Radix); 22 | #endif 23 | _CRTIMP errno_t __cdecl _ltoa_s(long _Val,char *_DstBuf,size_t _Size,int _Radix); 24 | _CRTIMP errno_t __cdecl mbstowcs_s(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount); 25 | _CRTIMP errno_t __cdecl _mbstowcs_s_l(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount,_locale_t _Locale); 26 | _CRTIMP errno_t __cdecl _ultoa_s(unsigned long _Val,char *_DstBuf,size_t _Size,int _Radix); 27 | _CRTIMP errno_t __cdecl _wctomb_s_l(int *_SizeConverted,char *_MbCh,size_t _SizeInBytes,wchar_t _WCh,_locale_t _Locale); 28 | _CRTIMP errno_t __cdecl wcstombs_s(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes); 29 | _CRTIMP errno_t __cdecl _wcstombs_s_l(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes,_locale_t _Locale); 30 | 31 | #ifndef _WSTDLIB_S_DEFINED 32 | #define _WSTDLIB_S_DEFINED 33 | _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 34 | _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 35 | _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 36 | _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); 37 | _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName); 38 | #if _INTEGRAL_MAX_BITS >= 64 39 | _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 40 | _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 41 | #endif 42 | #endif 43 | 44 | #ifndef _POSIX_ 45 | _CRTIMP errno_t __cdecl _ecvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDights,int *_PtDec,int *_PtSign); 46 | _CRTIMP errno_t __cdecl _fcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDec,int *_PtDec,int *_PtSign); 47 | _CRTIMP errno_t __cdecl _gcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDigits); 48 | _CRTIMP errno_t __cdecl _makepath_s(char *_PathResult,size_t _Size,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext); 49 | _CRTIMP errno_t __cdecl _putenv_s(const char *_Name,const char *_Value); 50 | _CRTIMP errno_t __cdecl _searchenv_s(const char *_Filename,const char *_EnvVar,char *_ResultPath,size_t _SizeInBytes); 51 | _CRTIMP errno_t __cdecl _splitpath_s(const char *_FullPath,char *_Drive,size_t _DriveSize,char *_Dir,size_t _DirSize,char *_Filename,size_t _FilenameSize,char *_Ext,size_t _ExtSize); 52 | 53 | #ifndef _WSTDLIBP_S_DEFINED 54 | #define _WSTDLIBP_S_DEFINED 55 | _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); 56 | _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value); 57 | _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); 58 | _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); 59 | #endif 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | #endif 68 | -------------------------------------------------------------------------------- /include/winapi/servprov.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __REQUIRED_RPCNDR_H_VERSION__ 7 | #define __REQUIRED_RPCNDR_H_VERSION__ 440 8 | #endif 9 | 10 | #include <_mingw.h> 11 | #include "rpc.h" 12 | #include "rpcndr.h" 13 | 14 | #ifndef __RPCNDR_H_VERSION__ 15 | #error This stub requires an updated version of 16 | #endif 17 | 18 | #ifndef COM_NO_WINDOWS_H 19 | #include "windows.h" 20 | #include "ole2.h" 21 | #endif 22 | 23 | #ifndef __servprov_h__ 24 | #define __servprov_h__ 25 | 26 | #ifndef __IServiceProvider_FWD_DEFINED__ 27 | #define __IServiceProvider_FWD_DEFINED__ 28 | typedef struct IServiceProvider IServiceProvider; 29 | #endif 30 | 31 | #include "objidl.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #ifndef __MIDL_user_allocate_free_DEFINED__ 38 | #define __MIDL_user_allocate_free_DEFINED__ 39 | void *__RPC_API MIDL_user_allocate(size_t); 40 | void __RPC_API MIDL_user_free(void *); 41 | #endif 42 | 43 | extern RPC_IF_HANDLE __MIDL_itf_servprov_0000_v0_0_c_ifspec; 44 | extern RPC_IF_HANDLE __MIDL_itf_servprov_0000_v0_0_s_ifspec; 45 | 46 | #ifndef __IServiceProvider_INTERFACE_DEFINED__ 47 | #define __IServiceProvider_INTERFACE_DEFINED__ 48 | typedef IServiceProvider *LPSERVICEPROVIDER; 49 | 50 | #if defined(__cplusplus) && !defined(CINTERFACE) 51 | EXTERN_C const IID IID_IServiceProvider; 52 | extern "C++" { 53 | struct IServiceProvider : public IUnknown { 54 | public: 55 | virtual HRESULT WINAPI QueryService(REFGUID guidService,REFIID riid,void **ppvObject) = 0; 56 | #if USE___UUIDOF != 0 57 | template HRESULT WINAPI QueryService(REFGUID guidService,Q **pp) { return QueryService(guidService,__uuidof(Q),(void **)pp); } 58 | #endif 59 | }; 60 | } 61 | HRESULT WINAPI IServiceProvider_RemoteQueryService_Proxy(IServiceProvider *This,REFGUID guidService,REFIID riid,IUnknown **ppvObject); 62 | void __RPC_STUB IServiceProvider_RemoteQueryService_Stub(IRpcStubBuffer *This,IRpcChannelBuffer *_pRpcChannelBuffer,PRPC_MESSAGE _pRpcMessage,DWORD *_pdwStubPhase); 63 | #else 64 | EXTERN_C const IID IID_IServiceProvider; 65 | #if defined(__cplusplus) && !defined(CINTERFACE) 66 | struct IServiceProvider : public IUnknown { 67 | public: 68 | virtual HRESULT WINAPI QueryService(REFGUID guidService,REFIID riid,void **ppvObject) = 0; 69 | }; 70 | #else 71 | typedef struct IServiceProviderVtbl { 72 | BEGIN_INTERFACE 73 | HRESULT (WINAPI *QueryInterface)(IServiceProvider *This,REFIID riid,void **ppvObject); 74 | ULONG (WINAPI *AddRef)(IServiceProvider *This); 75 | ULONG (WINAPI *Release)(IServiceProvider *This); 76 | HRESULT (WINAPI *QueryService)(IServiceProvider *This,REFGUID guidService,REFIID riid,void **ppvObject); 77 | END_INTERFACE 78 | } IServiceProviderVtbl; 79 | struct IServiceProvider { 80 | CONST_VTBL struct IServiceProviderVtbl *lpVtbl; 81 | }; 82 | #ifdef COBJMACROS 83 | #define IServiceProvider_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) 84 | #define IServiceProvider_AddRef(This) (This)->lpVtbl->AddRef(This) 85 | #define IServiceProvider_Release(This) (This)->lpVtbl->Release(This) 86 | #define IServiceProvider_QueryService(This,guidService,riid,ppvObject) (This)->lpVtbl->QueryService(This,guidService,riid,ppvObject) 87 | #endif 88 | #endif 89 | HRESULT WINAPI IServiceProvider_RemoteQueryService_Proxy(IServiceProvider *This,REFGUID guidService,REFIID riid,IUnknown **ppvObject); 90 | void __RPC_STUB IServiceProvider_RemoteQueryService_Stub(IRpcStubBuffer *This,IRpcChannelBuffer *_pRpcChannelBuffer,PRPC_MESSAGE _pRpcMessage,DWORD *_pdwStubPhase); 91 | #endif 92 | #endif 93 | 94 | extern RPC_IF_HANDLE __MIDL_itf_servprov_0093_v0_0_c_ifspec; 95 | extern RPC_IF_HANDLE __MIDL_itf_servprov_0093_v0_0_s_ifspec; 96 | 97 | HRESULT WINAPI IServiceProvider_QueryService_Proxy(IServiceProvider *This,REFGUID guidService,REFIID riid,void **ppvObject); 98 | HRESULT WINAPI IServiceProvider_QueryService_Stub(IServiceProvider *This,REFGUID guidService,REFIID riid,IUnknown **ppvObject); 99 | 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | #endif 104 | -------------------------------------------------------------------------------- /include/excpt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_EXCPT 7 | #define _INC_EXCPT 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | struct _EXCEPTION_POINTERS; 18 | 19 | #ifndef EXCEPTION_DISPOSITION 20 | #define EXCEPTION_DISPOSITION int 21 | #endif 22 | #define ExceptionContinueExecution 0 23 | #define ExceptionContinueSearch 1 24 | #define ExceptionNestedException 2 25 | #define ExceptionCollidedUnwind 3 26 | 27 | #if (defined(_X86_) && !defined(__x86_64)) 28 | struct _EXCEPTION_RECORD; 29 | struct _CONTEXT; 30 | 31 | EXCEPTION_DISPOSITION __cdecl _except_handler(struct _EXCEPTION_RECORD *_ExceptionRecord,void *_EstablisherFrame,struct _CONTEXT *_ContextRecord,void *_DispatcherContext); 32 | #elif defined(__ia64__) 33 | 34 | typedef struct _EXCEPTION_POINTERS *Exception_info_ptr; 35 | struct _EXCEPTION_RECORD; 36 | struct _CONTEXT; 37 | struct _DISPATCHER_CONTEXT; 38 | 39 | _CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler (struct _EXCEPTION_RECORD *_ExceptionRecord,unsigned __int64 _MemoryStackFp,unsigned __int64 _BackingStoreFp,struct _CONTEXT *_ContextRecord,struct _DISPATCHER_CONTEXT *_DispatcherContext,unsigned __int64 _GlobalPointer); 40 | #elif defined(__x86_64) 41 | 42 | struct _EXCEPTION_RECORD; 43 | struct _CONTEXT; 44 | #endif 45 | 46 | #define GetExceptionCode _exception_code 47 | #define exception_code _exception_code 48 | #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info 49 | #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info 50 | #define AbnormalTermination _abnormal_termination 51 | #define abnormal_termination _abnormal_termination 52 | 53 | unsigned long __cdecl _exception_code(void); 54 | void *__cdecl _exception_info(void); 55 | int __cdecl _abnormal_termination(void); 56 | 57 | #define EXCEPTION_EXECUTE_HANDLER 1 58 | #define EXCEPTION_CONTINUE_SEARCH 0 59 | #define EXCEPTION_CONTINUE_EXECUTION -1 60 | 61 | /* CRT stuff */ 62 | typedef void (__cdecl * _PHNDLR)(int); 63 | 64 | struct _XCPT_ACTION { 65 | unsigned long XcptNum; 66 | int SigNum; 67 | _PHNDLR XcptAction; 68 | }; 69 | 70 | extern struct _XCPT_ACTION _XcptActTab[]; 71 | extern int _XcptActTabCount; 72 | extern int _XcptActTabSize; 73 | extern int _First_FPE_Indx; 74 | extern int _Num_FPE; 75 | 76 | int __cdecl __CppXcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr); 77 | int __cdecl _XcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr); 78 | 79 | /* 80 | * The type of function that is expected as an exception handler to be 81 | * installed with _try1. 82 | */ 83 | typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); 84 | 85 | #ifndef HAVE_NO_SEH 86 | /* 87 | * This is not entirely necessary, but it is the structure installed by 88 | * the _try1 primitive below. 89 | */ 90 | typedef struct _EXCEPTION_REGISTRATION { 91 | struct _EXCEPTION_REGISTRATION *prev; 92 | EXCEPTION_DISPOSITION (*handler)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); 93 | } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION; 94 | 95 | typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD; 96 | typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD; 97 | #endif 98 | 99 | #if (defined(_X86_) && !defined(__x86_64)) 100 | #define __try1(pHandler) \ 101 | __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler)); 102 | 103 | #define __except1 \ 104 | __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \ 105 | : : : "%eax"); 106 | #elif defined(__x86_64) 107 | #define __try1(pHandler) \ 108 | __asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler)); 109 | 110 | #define __except1 \ 111 | __asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \ 112 | : : : "%rax"); 113 | #else 114 | #define __try1(pHandler) 115 | #define __except1 116 | #endif 117 | 118 | #ifdef __cplusplus 119 | } 120 | #endif 121 | 122 | #pragma pack(pop) 123 | #endif 124 | -------------------------------------------------------------------------------- /lib/ws2_32.def: -------------------------------------------------------------------------------- 1 | LIBRARY ws2_32.dll 2 | 3 | EXPORTS 4 | FreeAddrInfoEx 5 | FreeAddrInfoExW 6 | FreeAddrInfoW 7 | GetAddrInfoExA 8 | GetAddrInfoExCancel 9 | GetAddrInfoExOverlappedResult 10 | GetAddrInfoExW 11 | GetAddrInfoW 12 | GetHostNameW 13 | GetNameInfoW 14 | InetNtopW 15 | InetPtonW 16 | SetAddrInfoExA 17 | SetAddrInfoExW 18 | WEP 19 | WPUCompleteOverlappedRequest 20 | WPUGetProviderPathEx 21 | WSAAccept 22 | WSAAddressToStringA 23 | WSAAddressToStringW 24 | WSAAdvertiseProvider 25 | WSAAsyncGetHostByAddr 26 | WSAAsyncGetHostByName 27 | WSAAsyncGetProtoByName 28 | WSAAsyncGetProtoByNumber 29 | WSAAsyncGetServByName 30 | WSAAsyncGetServByPort 31 | WSAAsyncSelect 32 | WSACancelAsyncRequest 33 | WSACancelBlockingCall 34 | WSACleanup 35 | WSACloseEvent 36 | WSAConnect 37 | WSAConnectByList 38 | WSAConnectByNameA 39 | WSAConnectByNameW 40 | WSACreateEvent 41 | WSADuplicateSocketA 42 | WSADuplicateSocketW 43 | WSAEnumNameSpaceProvidersA 44 | WSAEnumNameSpaceProvidersExA 45 | WSAEnumNameSpaceProvidersExW 46 | WSAEnumNameSpaceProvidersW 47 | WSAEnumNetworkEvents 48 | WSAEnumProtocolsA 49 | WSAEnumProtocolsW 50 | WSAEventSelect 51 | WSAGetLastError 52 | WSAGetOverlappedResult 53 | WSAGetQOSByName 54 | WSAGetServiceClassInfoA 55 | WSAGetServiceClassInfoW 56 | WSAGetServiceClassNameByClassIdA 57 | WSAGetServiceClassNameByClassIdW 58 | WSAHtonl 59 | WSAHtons 60 | WSAInstallServiceClassA 61 | WSAInstallServiceClassW 62 | WSAIoctl 63 | WSAIsBlocking 64 | WSAJoinLeaf 65 | WSALookupServiceBeginA 66 | WSALookupServiceBeginW 67 | WSALookupServiceEnd 68 | WSALookupServiceNextA 69 | WSALookupServiceNextW 70 | WSANSPIoctl 71 | WSANtohl 72 | WSANtohs 73 | WSAPoll 74 | WSAProviderCompleteAsyncCall 75 | WSAProviderConfigChange 76 | WSARecv 77 | WSARecvDisconnect 78 | WSARecvFrom 79 | WSARemoveServiceClass 80 | WSAResetEvent 81 | WSASend 82 | WSASendDisconnect 83 | WSASendMsg 84 | WSASendTo 85 | WSASetBlockingHook 86 | WSASetEvent 87 | WSASetLastError 88 | WSASetServiceA 89 | WSASetServiceW 90 | WSASocketA 91 | WSASocketW 92 | WSAStartup 93 | WSAStringToAddressA 94 | WSAStringToAddressW 95 | WSAUnadvertiseProvider 96 | WSAUnhookBlockingHook 97 | WSAWaitForMultipleEvents 98 | WSApSetPostRoutine 99 | WSCDeinstallProvider 100 | WSCDeinstallProvider32 101 | WSCDeinstallProviderEx 102 | WSCEnableNSProvider 103 | WSCEnableNSProvider32 104 | WSCEnumNameSpaceProviders32 105 | WSCEnumNameSpaceProvidersEx32 106 | WSCEnumProtocols 107 | WSCEnumProtocols32 108 | WSCEnumProtocolsEx 109 | WSCGetApplicationCategory 110 | WSCGetApplicationCategoryEx 111 | WSCGetProviderInfo 112 | WSCGetProviderInfo32 113 | WSCGetProviderPath 114 | WSCGetProviderPath32 115 | WSCInstallNameSpace 116 | WSCInstallNameSpace32 117 | WSCInstallNameSpaceEx 118 | WSCInstallNameSpaceEx2 119 | WSCInstallNameSpaceEx32 120 | WSCInstallProvider 121 | WSCInstallProvider64_32 122 | WSCInstallProviderAndChains64_32 123 | WSCInstallProviderEx 124 | WSCSetApplicationCategory 125 | WSCSetApplicationCategoryEx 126 | WSCSetProviderInfo 127 | WSCSetProviderInfo32 128 | WSCUnInstallNameSpace 129 | WSCUnInstallNameSpace32 130 | WSCUnInstallNameSpaceEx2 131 | WSCUpdateProvider 132 | WSCUpdateProvider32 133 | WSCUpdateProviderEx 134 | WSCWriteNameSpaceOrder 135 | WSCWriteNameSpaceOrder32 136 | WSCWriteProviderOrder 137 | WSCWriteProviderOrder32 138 | WSCWriteProviderOrderEx 139 | WahCloseApcHelper 140 | WahCloseHandleHelper 141 | WahCloseNotificationHandleHelper 142 | WahCloseSocketHandle 143 | WahCloseThread 144 | WahCompleteRequest 145 | WahCreateHandleContextTable 146 | WahCreateNotificationHandle 147 | WahCreateSocketHandle 148 | WahDestroyHandleContextTable 149 | WahDisableNonIFSHandleSupport 150 | WahEnableNonIFSHandleSupport 151 | WahEnumerateHandleContexts 152 | WahInsertHandleContext 153 | WahNotifyAllProcesses 154 | WahOpenApcHelper 155 | WahOpenCurrentThread 156 | WahOpenHandleHelper 157 | WahOpenNotificationHandleHelper 158 | WahQueueUserApc 159 | WahReferenceContextByHandle 160 | WahRemoveHandleContext 161 | WahWaitForNotification 162 | WahWriteLSPEvent 163 | __WSAFDIsSet 164 | accept 165 | bind 166 | closesocket 167 | connect 168 | freeaddrinfo 169 | getaddrinfo 170 | gethostbyaddr 171 | gethostbyname 172 | gethostname 173 | getnameinfo 174 | getpeername 175 | getprotobyname 176 | getprotobynumber 177 | getservbyname 178 | getservbyport 179 | getsockname 180 | getsockopt 181 | htonl 182 | htons 183 | inet_addr 184 | inet_ntoa 185 | inet_ntop 186 | inet_pton 187 | ioctlsocket 188 | listen 189 | ntohl 190 | ntohs 191 | recv 192 | recvfrom 193 | select 194 | send 195 | sendto 196 | setsockopt 197 | shutdown 198 | socket 199 | -------------------------------------------------------------------------------- /include/_mingw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * _mingw.h 3 | * 4 | * This file is for TinyCC and not part of the Mingw32 package. 5 | * 6 | * THIS SOFTWARE IS NOT COPYRIGHTED 7 | * 8 | * This source code is offered for use in the public domain. You may 9 | * use, modify or distribute it freely. 10 | * 11 | * This code is distributed in the hope that it will be useful but 12 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 13 | * DISCLAIMED. This includes but is not limited to warranties of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * 16 | */ 17 | 18 | #ifndef __MINGW_H 19 | #define __MINGW_H 20 | 21 | /* some winapi files define these before including _mingw.h --> */ 22 | #undef __cdecl 23 | #undef _X86_ 24 | #undef WIN32 25 | /* <-- */ 26 | 27 | #include 28 | #include 29 | 30 | #define __int8 char 31 | #define __int16 short 32 | #define __int32 int 33 | #define __int64 long long 34 | #define _HAVE_INT64 35 | 36 | #define __cdecl 37 | #define __declspec(x) __attribute__((x)) 38 | #define __unaligned __attribute__((packed)) 39 | #define __fastcall __attribute__((fastcall)) 40 | 41 | #define __MSVCRT__ 1 42 | #undef _MSVCRT_ 43 | #define __MINGW_IMPORT extern __declspec(dllimport) 44 | #define __MINGW_ATTRIB_NORETURN __declspec(noreturn) 45 | #define __MINGW_ATTRIB_CONST 46 | #define __MINGW_ATTRIB_DEPRECATED 47 | #define __MINGW_ATTRIB_MALLOC 48 | #define __MINGW_ATTRIB_PURE 49 | #define __MINGW_ATTRIB_NONNULL(arg) 50 | #define __MINGW_NOTHROW 51 | #define __GNUC_VA_LIST 52 | 53 | #define _CRTIMP extern 54 | #define __CRT_INLINE static __inline__ 55 | 56 | #define _CRT_ALIGN(x) __attribute__((aligned(x))) 57 | #define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) 58 | #define _CRT_PACKING 8 59 | #define __CRT_UNALIGNED 60 | #define _CONST_RETURN 61 | 62 | #ifndef _TRUNCATE 63 | #define _TRUNCATE ((size_t)-1) 64 | #endif 65 | 66 | #define __CRT_STRINGIZE(_Value) #_Value 67 | #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value) 68 | #define __CRT_WIDE(_String) L ## _String 69 | #define _CRT_WIDE(_String) __CRT_WIDE(_String) 70 | 71 | #ifdef _WIN64 72 | #define __stdcall 73 | #define _AMD64_ 1 74 | #define __x86_64 1 75 | #define _M_X64 100 /* Visual Studio */ 76 | #define _M_AMD64 100 /* Visual Studio */ 77 | #define USE_MINGW_SETJMP_TWO_ARGS 78 | #define mingw_getsp tinyc_getbp 79 | #else 80 | #define __stdcall __attribute__((__stdcall__)) 81 | #define _X86_ 1 82 | #define _M_IX86 300 /* Visual Studio */ 83 | #define WIN32 1 84 | #define _USE_32BIT_TIME_T 85 | #endif 86 | 87 | /* in stddef.h */ 88 | #define _SIZE_T_DEFINED 89 | #define _SSIZE_T_DEFINED 90 | #define _PTRDIFF_T_DEFINED 91 | #define _WCHAR_T_DEFINED 92 | #define _UINTPTR_T_DEFINED 93 | #define _INTPTR_T_DEFINED 94 | #define _INTEGRAL_MAX_BITS 64 95 | 96 | #ifndef _TIME32_T_DEFINED 97 | #define _TIME32_T_DEFINED 98 | typedef long __time32_t; 99 | #endif 100 | 101 | #ifndef _TIME64_T_DEFINED 102 | #define _TIME64_T_DEFINED 103 | typedef long long __time64_t; 104 | #endif 105 | 106 | #ifndef _TIME_T_DEFINED 107 | #define _TIME_T_DEFINED 108 | #ifdef _USE_32BIT_TIME_T 109 | typedef __time32_t time_t; 110 | #else 111 | typedef __time64_t time_t; 112 | #endif 113 | #endif 114 | 115 | #ifndef _WCTYPE_T_DEFINED 116 | #define _WCTYPE_T_DEFINED 117 | typedef wchar_t wctype_t; 118 | #endif 119 | 120 | #ifndef _WINT_T 121 | #define _WINT_T 122 | typedef __WINT_TYPE__ wint_t; 123 | #endif 124 | 125 | typedef int errno_t; 126 | #define _ERRCODE_DEFINED 127 | 128 | typedef struct threadlocaleinfostruct *pthreadlocinfo; 129 | typedef struct threadmbcinfostruct *pthreadmbcinfo; 130 | typedef struct localeinfo_struct _locale_tstruct,*_locale_t; 131 | 132 | /* for winapi */ 133 | #define _ANONYMOUS_UNION 134 | #define _ANONYMOUS_STRUCT 135 | #define DECLSPEC_NORETURN __declspec(noreturn) 136 | #define DECLARE_STDCALL_P(type) __stdcall type 137 | #define NOSERVICE 1 138 | #define NOMCX 1 139 | #define NOIME 1 140 | #define __INTRIN_H_ 141 | #ifndef DUMMYUNIONNAME 142 | # define DUMMYUNIONNAME 143 | # define DUMMYUNIONNAME1 144 | # define DUMMYUNIONNAME2 145 | # define DUMMYUNIONNAME3 146 | # define DUMMYUNIONNAME4 147 | # define DUMMYUNIONNAME5 148 | #endif 149 | #ifndef DUMMYSTRUCTNAME 150 | # define DUMMYSTRUCTNAME 151 | #endif 152 | #ifndef WINVER 153 | # define WINVER 0x0502 154 | #endif 155 | #ifndef _WIN32_WINNT 156 | # define _WIN32_WINNT 0x502 157 | #endif 158 | 159 | #define __C89_NAMELESS 160 | #define __MINGW_EXTENSION 161 | #define WINAPI_FAMILY_PARTITION(X) 1 162 | #define MINGW_HAS_SECURE_API 163 | 164 | #endif /* __MINGW_H */ 165 | -------------------------------------------------------------------------------- /include/setjmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SETJMP 7 | #define _INC_SETJMP 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #if (defined(_X86_) && !defined(__x86_64)) 18 | 19 | #define _JBLEN 16 20 | #define _JBTYPE int 21 | 22 | typedef struct __JUMP_BUFFER { 23 | unsigned long Ebp; 24 | unsigned long Ebx; 25 | unsigned long Edi; 26 | unsigned long Esi; 27 | unsigned long Esp; 28 | unsigned long Eip; 29 | unsigned long Registration; 30 | unsigned long TryLevel; 31 | unsigned long Cookie; 32 | unsigned long UnwindFunc; 33 | unsigned long UnwindData[6]; 34 | } _JUMP_BUFFER; 35 | #elif defined(__ia64__) 36 | typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 { 37 | __int64 LowPart; 38 | __int64 HighPart; 39 | } SETJMP_FLOAT128; 40 | 41 | #define _JBLEN 33 42 | typedef SETJMP_FLOAT128 _JBTYPE; 43 | 44 | typedef struct __JUMP_BUFFER { 45 | 46 | unsigned long iAReserved[6]; 47 | 48 | unsigned long Registration; 49 | unsigned long TryLevel; 50 | unsigned long Cookie; 51 | unsigned long UnwindFunc; 52 | 53 | unsigned long UnwindData[6]; 54 | 55 | SETJMP_FLOAT128 FltS0; 56 | SETJMP_FLOAT128 FltS1; 57 | SETJMP_FLOAT128 FltS2; 58 | SETJMP_FLOAT128 FltS3; 59 | SETJMP_FLOAT128 FltS4; 60 | SETJMP_FLOAT128 FltS5; 61 | SETJMP_FLOAT128 FltS6; 62 | SETJMP_FLOAT128 FltS7; 63 | SETJMP_FLOAT128 FltS8; 64 | SETJMP_FLOAT128 FltS9; 65 | SETJMP_FLOAT128 FltS10; 66 | SETJMP_FLOAT128 FltS11; 67 | SETJMP_FLOAT128 FltS12; 68 | SETJMP_FLOAT128 FltS13; 69 | SETJMP_FLOAT128 FltS14; 70 | SETJMP_FLOAT128 FltS15; 71 | SETJMP_FLOAT128 FltS16; 72 | SETJMP_FLOAT128 FltS17; 73 | SETJMP_FLOAT128 FltS18; 74 | SETJMP_FLOAT128 FltS19; 75 | __int64 FPSR; 76 | __int64 StIIP; 77 | __int64 BrS0; 78 | __int64 BrS1; 79 | __int64 BrS2; 80 | __int64 BrS3; 81 | __int64 BrS4; 82 | __int64 IntS0; 83 | __int64 IntS1; 84 | __int64 IntS2; 85 | __int64 IntS3; 86 | __int64 RsBSP; 87 | __int64 RsPFS; 88 | __int64 ApUNAT; 89 | __int64 ApLC; 90 | __int64 IntSp; 91 | __int64 IntNats; 92 | __int64 Preds; 93 | 94 | } _JUMP_BUFFER; 95 | #elif defined(__x86_64) 96 | typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 { 97 | unsigned __int64 Part[2]; 98 | } SETJMP_FLOAT128; 99 | 100 | #define _JBLEN 16 101 | typedef SETJMP_FLOAT128 _JBTYPE; 102 | 103 | typedef struct _JUMP_BUFFER { 104 | unsigned __int64 Frame; 105 | unsigned __int64 Rbx; 106 | unsigned __int64 Rsp; 107 | unsigned __int64 Rbp; 108 | unsigned __int64 Rsi; 109 | unsigned __int64 Rdi; 110 | unsigned __int64 R12; 111 | unsigned __int64 R13; 112 | unsigned __int64 R14; 113 | unsigned __int64 R15; 114 | unsigned __int64 Rip; 115 | unsigned __int64 Spare; 116 | SETJMP_FLOAT128 Xmm6; 117 | SETJMP_FLOAT128 Xmm7; 118 | SETJMP_FLOAT128 Xmm8; 119 | SETJMP_FLOAT128 Xmm9; 120 | SETJMP_FLOAT128 Xmm10; 121 | SETJMP_FLOAT128 Xmm11; 122 | SETJMP_FLOAT128 Xmm12; 123 | SETJMP_FLOAT128 Xmm13; 124 | SETJMP_FLOAT128 Xmm14; 125 | SETJMP_FLOAT128 Xmm15; 126 | } _JUMP_BUFFER; 127 | #endif 128 | #ifndef _JMP_BUF_DEFINED 129 | typedef _JBTYPE jmp_buf[_JBLEN]; 130 | #define _JMP_BUF_DEFINED 131 | #endif 132 | 133 | void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp(void); 134 | 135 | #ifdef USE_MINGW_SETJMP_TWO_ARGS 136 | #ifndef _INC_SETJMPEX 137 | #define setjmp(BUF) _setjmp((BUF),mingw_getsp()) 138 | int __cdecl __attribute__ ((__nothrow__)) _setjmp(jmp_buf _Buf,void *_Ctx); 139 | #else 140 | #undef setjmp 141 | #define setjmp(BUF) _setjmpex((BUF),mingw_getsp()) 142 | #define setjmpex(BUF) _setjmpex((BUF),mingw_getsp()) 143 | int __cdecl __attribute__ ((__nothrow__)) _setjmpex(jmp_buf _Buf,void *_Ctx); 144 | #endif 145 | #else 146 | #ifndef _INC_SETJMPEX 147 | #define setjmp _setjmp 148 | #endif 149 | int __cdecl __attribute__ ((__nothrow__)) setjmp(jmp_buf _Buf); 150 | #endif 151 | 152 | __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/; 153 | __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl longjmp(jmp_buf _Buf,int _Value); 154 | 155 | #ifdef __cplusplus 156 | } 157 | #endif 158 | 159 | #pragma pack(pop) 160 | #endif 161 | -------------------------------------------------------------------------------- /include/winapi/guiddef.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef GUID_DEFINED 7 | #define GUID_DEFINED 8 | typedef struct _GUID { 9 | unsigned long Data1; 10 | unsigned short Data2; 11 | unsigned short Data3; 12 | unsigned char Data4[8 ]; 13 | } GUID; 14 | #endif 15 | 16 | #ifndef UUID_DEFINED 17 | #define UUID_DEFINED 18 | typedef GUID UUID; 19 | #endif 20 | 21 | #ifndef FAR 22 | #define FAR 23 | #endif 24 | 25 | #ifndef DECLSPEC_SELECTANY 26 | #define DECLSPEC_SELECTANY __declspec(selectany) 27 | #endif 28 | 29 | #ifndef EXTERN_C 30 | #ifdef __cplusplus 31 | #define EXTERN_C extern "C" 32 | #else 33 | #define EXTERN_C extern 34 | #endif 35 | #endif 36 | 37 | #ifdef DEFINE_GUID 38 | #undef DEFINE_GUID 39 | #endif 40 | 41 | #ifdef INITGUID 42 | #ifdef __cplusplus 43 | #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } } 44 | #else 45 | #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } } 46 | #endif 47 | #else 48 | #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name 49 | #endif 50 | 51 | #define DEFINE_OLEGUID(name,l,w1,w2) DEFINE_GUID(name,l,w1,w2,0xC0,0,0,0,0,0,0,0x46) 52 | 53 | #ifndef _GUIDDEF_H_ 54 | #define _GUIDDEF_H_ 55 | 56 | #ifndef __LPGUID_DEFINED__ 57 | #define __LPGUID_DEFINED__ 58 | typedef GUID *LPGUID; 59 | #endif 60 | 61 | #ifndef __LPCGUID_DEFINED__ 62 | #define __LPCGUID_DEFINED__ 63 | typedef const GUID *LPCGUID; 64 | #endif 65 | 66 | #ifndef __IID_DEFINED__ 67 | #define __IID_DEFINED__ 68 | 69 | typedef GUID IID; 70 | typedef IID *LPIID; 71 | #define IID_NULL GUID_NULL 72 | #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2) 73 | typedef GUID CLSID; 74 | typedef CLSID *LPCLSID; 75 | #define CLSID_NULL GUID_NULL 76 | #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2) 77 | typedef GUID FMTID; 78 | typedef FMTID *LPFMTID; 79 | #define FMTID_NULL GUID_NULL 80 | #define IsEqualFMTID(rfmtid1,rfmtid2) IsEqualGUID(rfmtid1,rfmtid2) 81 | 82 | #ifdef __midl_proxy 83 | #define __MIDL_CONST 84 | #else 85 | #define __MIDL_CONST const 86 | #endif 87 | 88 | #ifndef _REFGUID_DEFINED 89 | #define _REFGUID_DEFINED 90 | #ifdef __cplusplus 91 | #define REFGUID const GUID & 92 | #else 93 | #define REFGUID const GUID *__MIDL_CONST 94 | #endif 95 | #endif 96 | 97 | #ifndef _REFIID_DEFINED 98 | #define _REFIID_DEFINED 99 | #ifdef __cplusplus 100 | #define REFIID const IID & 101 | #else 102 | #define REFIID const IID *__MIDL_CONST 103 | #endif 104 | #endif 105 | 106 | #ifndef _REFCLSID_DEFINED 107 | #define _REFCLSID_DEFINED 108 | #ifdef __cplusplus 109 | #define REFCLSID const IID & 110 | #else 111 | #define REFCLSID const IID *__MIDL_CONST 112 | #endif 113 | #endif 114 | 115 | #ifndef _REFFMTID_DEFINED 116 | #define _REFFMTID_DEFINED 117 | #ifdef __cplusplus 118 | #define REFFMTID const IID & 119 | #else 120 | #define REFFMTID const IID *__MIDL_CONST 121 | #endif 122 | #endif 123 | #endif 124 | 125 | #ifndef _SYS_GUID_OPERATORS_ 126 | #define _SYS_GUID_OPERATORS_ 127 | #include 128 | 129 | #ifdef __cplusplus 130 | __inline int InlineIsEqualGUID(REFGUID rguid1,REFGUID rguid2) { 131 | return (((unsigned long *) &rguid1)[0]==((unsigned long *) &rguid2)[0] && ((unsigned long *) &rguid1)[1]==((unsigned long *) &rguid2)[1] && 132 | ((unsigned long *) &rguid1)[2]==((unsigned long *) &rguid2)[2] && ((unsigned long *) &rguid1)[3]==((unsigned long *) &rguid2)[3]); 133 | } 134 | __inline int IsEqualGUID(REFGUID rguid1,REFGUID rguid2) { return !memcmp(&rguid1,&rguid2,sizeof(GUID)); } 135 | #else 136 | #define InlineIsEqualGUID(rguid1,rguid2) (((unsigned long *) rguid1)[0]==((unsigned long *) rguid2)[0] && ((unsigned long *) rguid1)[1]==((unsigned long *) rguid2)[1] && ((unsigned long *) rguid1)[2]==((unsigned long *) rguid2)[2] && ((unsigned long *) rguid1)[3]==((unsigned long *) rguid2)[3]) 137 | #define IsEqualGUID(rguid1,rguid2) (!memcmp(rguid1,rguid2,sizeof(GUID))) 138 | #endif 139 | 140 | #ifdef __INLINE_ISEQUAL_GUID 141 | #undef IsEqualGUID 142 | #define IsEqualGUID(rguid1,rguid2) InlineIsEqualGUID(rguid1,rguid2) 143 | #endif 144 | 145 | #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2) 146 | #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2) 147 | 148 | #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_ 149 | #define _SYS_GUID_OPERATOR_EQ_ 150 | #ifdef __cplusplus 151 | __inline int operator==(REFGUID guidOne,REFGUID guidOther) { return IsEqualGUID(guidOne,guidOther); } 152 | __inline int operator!=(REFGUID guidOne,REFGUID guidOther) { return !(guidOne==guidOther); } 153 | #endif 154 | #endif 155 | #endif 156 | #endif 157 | -------------------------------------------------------------------------------- /include/wctype.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_WCTYPE 7 | #define _INC_WCTYPE 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifndef _CRTIMP 22 | #define _CRTIMP __declspec(dllimport) 23 | #endif 24 | 25 | #ifndef _WCHAR_T_DEFINED 26 | typedef unsigned short wchar_t; 27 | #define _WCHAR_T_DEFINED 28 | #endif 29 | 30 | #ifndef _WCTYPE_T_DEFINED 31 | typedef unsigned short wint_t; 32 | typedef unsigned short wctype_t; 33 | #define _WCTYPE_T_DEFINED 34 | #endif 35 | 36 | #ifndef WEOF 37 | #define WEOF (wint_t)(0xFFFF) 38 | #endif 39 | 40 | #ifndef _CRT_CTYPEDATA_DEFINED 41 | #define _CRT_CTYPEDATA_DEFINED 42 | #ifndef _CTYPE_DISABLE_MACROS 43 | 44 | #ifndef __PCTYPE_FUNC 45 | #define __PCTYPE_FUNC __pctype_func() 46 | #ifdef _MSVCRT_ 47 | #define __pctype_func() (_pctype) 48 | #else 49 | #define __pctype_func() (*_imp___pctype) 50 | #endif 51 | #endif 52 | 53 | #ifndef _pctype 54 | #ifdef _MSVCRT_ 55 | extern unsigned short *_pctype; 56 | #else 57 | extern unsigned short **_imp___pctype; 58 | #define _pctype (*_imp___pctype) 59 | #endif 60 | #endif 61 | 62 | #endif 63 | #endif 64 | 65 | #ifndef _CRT_WCTYPEDATA_DEFINED 66 | #define _CRT_WCTYPEDATA_DEFINED 67 | #ifndef _CTYPE_DISABLE_MACROS 68 | #ifndef _wctype 69 | #ifdef _MSVCRT_ 70 | extern unsigned short *_wctype; 71 | #else 72 | extern unsigned short **_imp___wctype; 73 | #define _wctype (*_imp___wctype) 74 | #endif 75 | #endif 76 | 77 | #ifndef _pwctype 78 | #ifdef _MSVCRT_ 79 | extern unsigned short *_pwctype; 80 | #else 81 | extern unsigned short **_imp___pwctype; 82 | #define _pwctype (*_imp___pwctype) 83 | #define __pwctype_func() (*_imp___pwctype) 84 | #endif 85 | #endif 86 | #endif 87 | #endif 88 | 89 | #define _UPPER 0x1 90 | #define _LOWER 0x2 91 | #define _DIGIT 0x4 92 | #define _SPACE 0x8 93 | 94 | #define _PUNCT 0x10 95 | #define _CONTROL 0x20 96 | #define _BLANK 0x40 97 | #define _HEX 0x80 98 | 99 | #define _LEADBYTE 0x8000 100 | #define _ALPHA (0x0100|_UPPER|_LOWER) 101 | 102 | #ifndef _WCTYPE_DEFINED 103 | #define _WCTYPE_DEFINED 104 | 105 | int __cdecl iswalpha(wint_t); 106 | int __cdecl iswupper(wint_t); 107 | int __cdecl iswlower(wint_t); 108 | int __cdecl iswdigit(wint_t); 109 | int __cdecl iswxdigit(wint_t); 110 | int __cdecl iswspace(wint_t); 111 | int __cdecl iswpunct(wint_t); 112 | int __cdecl iswalnum(wint_t); 113 | int __cdecl iswprint(wint_t); 114 | int __cdecl iswgraph(wint_t); 115 | int __cdecl iswcntrl(wint_t); 116 | int __cdecl iswascii(wint_t); 117 | int __cdecl isleadbyte(int); 118 | wint_t __cdecl towupper(wint_t); 119 | wint_t __cdecl towlower(wint_t); 120 | int __cdecl iswctype(wint_t,wctype_t); 121 | _CRTIMP int __cdecl __iswcsymf(wint_t); 122 | _CRTIMP int __cdecl __iswcsym(wint_t); 123 | int __cdecl is_wctype(wint_t,wctype_t); 124 | #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES) 125 | int __cdecl isblank(int _C); 126 | #endif 127 | #endif 128 | 129 | #ifndef _WCTYPE_INLINE_DEFINED 130 | #define _WCTYPE_INLINE_DEFINED 131 | #ifndef __cplusplus 132 | #define iswalpha(_c) (iswctype(_c,_ALPHA)) 133 | #define iswupper(_c) (iswctype(_c,_UPPER)) 134 | #define iswlower(_c) (iswctype(_c,_LOWER)) 135 | #define iswdigit(_c) (iswctype(_c,_DIGIT)) 136 | #define iswxdigit(_c) (iswctype(_c,_HEX)) 137 | #define iswspace(_c) (iswctype(_c,_SPACE)) 138 | #define iswpunct(_c) (iswctype(_c,_PUNCT)) 139 | #define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT)) 140 | #define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT)) 141 | #define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT)) 142 | #define iswcntrl(_c) (iswctype(_c,_CONTROL)) 143 | #define iswascii(_c) ((unsigned)(_c) < 0x80) 144 | #define isleadbyte(c) (__pctype_func()[(unsigned char)(c)] & _LEADBYTE) 145 | #else 146 | __CRT_INLINE int __cdecl iswalpha(wint_t _C) {return (iswctype(_C,_ALPHA)); } 147 | __CRT_INLINE int __cdecl iswupper(wint_t _C) {return (iswctype(_C,_UPPER)); } 148 | __CRT_INLINE int __cdecl iswlower(wint_t _C) {return (iswctype(_C,_LOWER)); } 149 | __CRT_INLINE int __cdecl iswdigit(wint_t _C) {return (iswctype(_C,_DIGIT)); } 150 | __CRT_INLINE int __cdecl iswxdigit(wint_t _C) {return (iswctype(_C,_HEX)); } 151 | __CRT_INLINE int __cdecl iswspace(wint_t _C) {return (iswctype(_C,_SPACE)); } 152 | __CRT_INLINE int __cdecl iswpunct(wint_t _C) {return (iswctype(_C,_PUNCT)); } 153 | __CRT_INLINE int __cdecl iswalnum(wint_t _C) {return (iswctype(_C,_ALPHA|_DIGIT)); } 154 | __CRT_INLINE int __cdecl iswprint(wint_t _C) {return (iswctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)); } 155 | __CRT_INLINE int __cdecl iswgraph(wint_t _C) {return (iswctype(_C,_PUNCT|_ALPHA|_DIGIT)); } 156 | __CRT_INLINE int __cdecl iswcntrl(wint_t _C) {return (iswctype(_C,_CONTROL)); } 157 | __CRT_INLINE int __cdecl iswascii(wint_t _C) {return ((unsigned)(_C) < 0x80); } 158 | __CRT_INLINE int __cdecl isleadbyte(int _C) {return (__pctype_func()[(unsigned char)(_C)] & _LEADBYTE); } 159 | #endif 160 | #endif 161 | 162 | typedef wchar_t wctrans_t; 163 | wint_t __cdecl towctrans(wint_t,wctrans_t); 164 | wctrans_t __cdecl wctrans(const char *); 165 | wctype_t __cdecl wctype(const char *); 166 | 167 | #ifdef __cplusplus 168 | } 169 | #endif 170 | 171 | #pragma pack(pop) 172 | #endif 173 | -------------------------------------------------------------------------------- /include/malloc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _MALLOC_H_ 7 | #define _MALLOC_H_ 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifndef _MM_MALLOC_H_INCLUDED 14 | #define _MM_MALLOC_H_INCLUDED 15 | #endif 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifdef _WIN64 22 | #define _HEAP_MAXREQ 0xFFFFFFFFFFFFFFE0 23 | #else 24 | #define _HEAP_MAXREQ 0xFFFFFFE0 25 | #endif 26 | 27 | #ifndef _STATIC_ASSERT 28 | #define _STATIC_ASSERT(expr) extern void __static_assert_t(int [(expr)?1:-1]) 29 | #endif 30 | 31 | /* Return codes for _heapwalk() */ 32 | #define _HEAPEMPTY (-1) 33 | #define _HEAPOK (-2) 34 | #define _HEAPBADBEGIN (-3) 35 | #define _HEAPBADNODE (-4) 36 | #define _HEAPEND (-5) 37 | #define _HEAPBADPTR (-6) 38 | 39 | /* Values for _heapinfo.useflag */ 40 | #define _FREEENTRY 0 41 | #define _USEDENTRY 1 42 | 43 | #ifndef _HEAPINFO_DEFINED 44 | #define _HEAPINFO_DEFINED 45 | /* The structure used to walk through the heap with _heapwalk. */ 46 | typedef struct _heapinfo { 47 | int *_pentry; 48 | size_t _size; 49 | int _useflag; 50 | } _HEAPINFO; 51 | #endif 52 | 53 | extern unsigned int _amblksiz; 54 | 55 | #define _mm_free(a) _aligned_free(a) 56 | #define _mm_malloc(a,b) _aligned_malloc(a,b) 57 | 58 | #ifndef _CRT_ALLOCATION_DEFINED 59 | #define _CRT_ALLOCATION_DEFINED 60 | void *__cdecl calloc(size_t _NumOfElements,size_t _SizeOfElements); 61 | void __cdecl free(void *_Memory); 62 | void *__cdecl malloc(size_t _Size); 63 | void *__cdecl realloc(void *_Memory,size_t _NewSize); 64 | _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size); 65 | /* _CRTIMP void __cdecl _aligned_free(void *_Memory); 66 | _CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment); */ 67 | _CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset); 68 | _CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment); 69 | _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment); 70 | _CRTIMP void *__cdecl _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset); 71 | _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset); 72 | #endif 73 | 74 | #define _MAX_WAIT_MALLOC_CRT 60000 75 | 76 | _CRTIMP int __cdecl _resetstkoflw (void); 77 | _CRTIMP unsigned long __cdecl _set_malloc_crt_max_wait(unsigned long _NewValue); 78 | 79 | _CRTIMP void *__cdecl _expand(void *_Memory,size_t _NewSize); 80 | _CRTIMP size_t __cdecl _msize(void *_Memory); 81 | #ifdef __GNUC__ 82 | #undef _alloca 83 | #define _alloca(x) __builtin_alloca((x)) 84 | #else 85 | /* tcc implements alloca internally and exposes it (since commit d778bde7). 86 | /* alloca is declared at include/stddef.h (which is distributed with tcc). 87 | */ 88 | #ifdef _alloca 89 | #undef _alloca 90 | #endif 91 | #define _alloca(x) alloca((x)) 92 | #endif 93 | _CRTIMP size_t __cdecl _get_sbh_threshold(void); 94 | _CRTIMP int __cdecl _set_sbh_threshold(size_t _NewValue); 95 | _CRTIMP errno_t __cdecl _set_amblksiz(size_t _Value); 96 | _CRTIMP errno_t __cdecl _get_amblksiz(size_t *_Value); 97 | _CRTIMP int __cdecl _heapadd(void *_Memory,size_t _Size); 98 | _CRTIMP int __cdecl _heapchk(void); 99 | _CRTIMP int __cdecl _heapmin(void); 100 | _CRTIMP int __cdecl _heapset(unsigned int _Fill); 101 | _CRTIMP int __cdecl _heapwalk(_HEAPINFO *_EntryInfo); 102 | _CRTIMP size_t __cdecl _heapused(size_t *_Used,size_t *_Commit); 103 | _CRTIMP intptr_t __cdecl _get_heap_handle(void); 104 | 105 | #define _ALLOCA_S_THRESHOLD 1024 106 | #define _ALLOCA_S_STACK_MARKER 0xCCCC 107 | #define _ALLOCA_S_HEAP_MARKER 0xDDDD 108 | 109 | #if(defined(_X86_) && !defined(__x86_64)) 110 | #define _ALLOCA_S_MARKER_SIZE 8 111 | #elif defined(__ia64__) || defined(__x86_64) 112 | #define _ALLOCA_S_MARKER_SIZE 16 113 | #endif 114 | 115 | #if !defined(RC_INVOKED) 116 | static __inline void *_MarkAllocaS(void *_Ptr,unsigned int _Marker) { 117 | if(_Ptr) { 118 | *((unsigned int*)_Ptr) = _Marker; 119 | _Ptr = (char*)_Ptr + _ALLOCA_S_MARKER_SIZE; 120 | } 121 | return _Ptr; 122 | } 123 | #endif 124 | 125 | #undef _malloca 126 | #define _malloca(size) \ 127 | ((((size) + _ALLOCA_S_MARKER_SIZE) <= _ALLOCA_S_THRESHOLD) ? \ 128 | _MarkAllocaS(_alloca((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_STACK_MARKER) : \ 129 | _MarkAllocaS(malloc((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_HEAP_MARKER)) 130 | #undef _FREEA_INLINE 131 | #define _FREEA_INLINE 132 | 133 | #ifndef RC_INVOKED 134 | #undef _freea 135 | static __inline void __cdecl _freea(void *_Memory) { 136 | unsigned int _Marker; 137 | if(_Memory) { 138 | _Memory = (char*)_Memory - _ALLOCA_S_MARKER_SIZE; 139 | _Marker = *(unsigned int *)_Memory; 140 | if(_Marker==_ALLOCA_S_HEAP_MARKER) { 141 | free(_Memory); 142 | } 143 | #ifdef _ASSERTE 144 | else if(_Marker!=_ALLOCA_S_STACK_MARKER) { 145 | _ASSERTE(("Corrupted pointer passed to _freea",0)); 146 | } 147 | #endif 148 | } 149 | } 150 | #endif /* RC_INVOKED */ 151 | 152 | #ifndef NO_OLDNAMES 153 | #ifdef __GNUC__ 154 | #undef alloca 155 | #define alloca(x) __builtin_alloca((x)) 156 | #endif 157 | #endif 158 | 159 | #ifdef HEAPHOOK 160 | #ifndef _HEAPHOOK_DEFINED 161 | #define _HEAPHOOK_DEFINED 162 | typedef int (__cdecl *_HEAPHOOK)(int,size_t,void *,void **); 163 | #endif 164 | 165 | _CRTIMP _HEAPHOOK __cdecl _setheaphook(_HEAPHOOK _NewHook); 166 | 167 | #define _HEAP_MALLOC 1 168 | #define _HEAP_CALLOC 2 169 | #define _HEAP_FREE 3 170 | #define _HEAP_REALLOC 4 171 | #define _HEAP_MSIZE 5 172 | #define _HEAP_EXPAND 6 173 | #endif 174 | 175 | #ifdef __cplusplus 176 | } 177 | #endif 178 | 179 | #pragma pack(pop) 180 | 181 | #endif /* _MALLOC_H_ */ 182 | -------------------------------------------------------------------------------- /include/winapi/winver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef VER_H 7 | #define VER_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #define VS_FILE_INFO RT_VERSION 14 | #define VS_VERSION_INFO 1 15 | #define VS_USER_DEFINED 100 16 | 17 | #define VS_FFI_SIGNATURE 0xFEEF04BDL 18 | #define VS_FFI_STRUCVERSION 0x00010000L 19 | #define VS_FFI_FILEFLAGSMASK 0x0000003FL 20 | 21 | #define VS_FF_DEBUG 0x00000001L 22 | #define VS_FF_PRERELEASE 0x00000002L 23 | #define VS_FF_PATCHED 0x00000004L 24 | #define VS_FF_PRIVATEBUILD 0x00000008L 25 | #define VS_FF_INFOINFERRED 0x00000010L 26 | #define VS_FF_SPECIALBUILD 0x00000020L 27 | 28 | #define VOS_UNKNOWN 0x00000000L 29 | #define VOS_DOS 0x00010000L 30 | #define VOS_OS216 0x00020000L 31 | #define VOS_OS232 0x00030000L 32 | #define VOS_NT 0x00040000L 33 | #define VOS_WINCE 0x00050000L 34 | 35 | #define VOS__BASE 0x00000000L 36 | #define VOS__WINDOWS16 0x00000001L 37 | #define VOS__PM16 0x00000002L 38 | #define VOS__PM32 0x00000003L 39 | #define VOS__WINDOWS32 0x00000004L 40 | 41 | #define VOS_DOS_WINDOWS16 0x00010001L 42 | #define VOS_DOS_WINDOWS32 0x00010004L 43 | #define VOS_OS216_PM16 0x00020002L 44 | #define VOS_OS232_PM32 0x00030003L 45 | #define VOS_NT_WINDOWS32 0x00040004L 46 | 47 | #define VFT_UNKNOWN 0x00000000L 48 | #define VFT_APP 0x00000001L 49 | #define VFT_DLL 0x00000002L 50 | #define VFT_DRV 0x00000003L 51 | #define VFT_FONT 0x00000004L 52 | #define VFT_VXD 0x00000005L 53 | #define VFT_STATIC_LIB 0x00000007L 54 | 55 | #define VFT2_UNKNOWN 0x00000000L 56 | #define VFT2_DRV_PRINTER 0x00000001L 57 | #define VFT2_DRV_KEYBOARD 0x00000002L 58 | #define VFT2_DRV_LANGUAGE 0x00000003L 59 | #define VFT2_DRV_DISPLAY 0x00000004L 60 | #define VFT2_DRV_MOUSE 0x00000005L 61 | #define VFT2_DRV_NETWORK 0x00000006L 62 | #define VFT2_DRV_SYSTEM 0x00000007L 63 | #define VFT2_DRV_INSTALLABLE 0x00000008L 64 | #define VFT2_DRV_SOUND 0x00000009L 65 | #define VFT2_DRV_COMM 0x0000000AL 66 | #define VFT2_DRV_INPUTMETHOD 0x0000000BL 67 | #define VFT2_DRV_VERSIONED_PRINTER 0x0000000CL 68 | 69 | #define VFT2_FONT_RASTER 0x00000001L 70 | #define VFT2_FONT_VECTOR 0x00000002L 71 | #define VFT2_FONT_TRUETYPE 0x00000003L 72 | 73 | #define VFFF_ISSHAREDFILE 0x0001 74 | 75 | #define VFF_CURNEDEST 0x0001 76 | #define VFF_FILEINUSE 0x0002 77 | #define VFF_BUFFTOOSMALL 0x0004 78 | 79 | #define VIFF_FORCEINSTALL 0x0001 80 | #define VIFF_DONTDELETEOLD 0x0002 81 | 82 | #define VIF_TEMPFILE 0x00000001L 83 | #define VIF_MISMATCH 0x00000002L 84 | #define VIF_SRCOLD 0x00000004L 85 | 86 | #define VIF_DIFFLANG 0x00000008L 87 | #define VIF_DIFFCODEPG 0x00000010L 88 | #define VIF_DIFFTYPE 0x00000020L 89 | 90 | #define VIF_WRITEPROT 0x00000040L 91 | #define VIF_FILEINUSE 0x00000080L 92 | #define VIF_OUTOFSPACE 0x00000100L 93 | #define VIF_ACCESSVIOLATION 0x00000200L 94 | #define VIF_SHARINGVIOLATION 0x00000400L 95 | #define VIF_CANNOTCREATE 0x00000800L 96 | #define VIF_CANNOTDELETE 0x00001000L 97 | #define VIF_CANNOTRENAME 0x00002000L 98 | #define VIF_CANNOTDELETECUR 0x00004000L 99 | #define VIF_OUTOFMEMORY 0x00008000L 100 | 101 | #define VIF_CANNOTREADSRC 0x00010000L 102 | #define VIF_CANNOTREADDST 0x00020000L 103 | 104 | #define VIF_BUFFTOOSMALL 0x00040000L 105 | #define VIF_CANNOTLOADLZ32 0x00080000L 106 | #define VIF_CANNOTLOADCABINET 0x00100000L 107 | 108 | #ifndef RC_INVOKED 109 | 110 | typedef struct tagVS_FIXEDFILEINFO 111 | { 112 | DWORD dwSignature; 113 | DWORD dwStrucVersion; 114 | DWORD dwFileVersionMS; 115 | DWORD dwFileVersionLS; 116 | DWORD dwProductVersionMS; 117 | DWORD dwProductVersionLS; 118 | DWORD dwFileFlagsMask; 119 | DWORD dwFileFlags; 120 | DWORD dwFileOS; 121 | DWORD dwFileType; 122 | DWORD dwFileSubtype; 123 | DWORD dwFileDateMS; 124 | DWORD dwFileDateLS; 125 | } VS_FIXEDFILEINFO; 126 | 127 | #ifdef UNICODE 128 | #define VerFindFile VerFindFileW 129 | #define VerInstallFile VerInstallFileW 130 | #define GetFileVersionInfoSize GetFileVersionInfoSizeW 131 | #define GetFileVersionInfo GetFileVersionInfoW 132 | #define VerLanguageName VerLanguageNameW 133 | #define VerQueryValue VerQueryValueW 134 | #else 135 | #define VerFindFile VerFindFileA 136 | #define VerInstallFile VerInstallFileA 137 | #define GetFileVersionInfoSize GetFileVersionInfoSizeA 138 | #define GetFileVersionInfo GetFileVersionInfoA 139 | #define VerLanguageName VerLanguageNameA 140 | #define VerQueryValue VerQueryValueA 141 | #endif 142 | 143 | DWORD WINAPI VerFindFileA(DWORD uFlags,LPSTR szFileName,LPSTR szWinDir,LPSTR szAppDir,LPSTR szCurDir,PUINT lpuCurDirLen,LPSTR szDestDir,PUINT lpuDestDirLen); 144 | DWORD WINAPI VerFindFileW(DWORD uFlags,LPWSTR szFileName,LPWSTR szWinDir,LPWSTR szAppDir,LPWSTR szCurDir,PUINT lpuCurDirLen,LPWSTR szDestDir,PUINT lpuDestDirLen); 145 | DWORD WINAPI VerInstallFileA(DWORD uFlags,LPSTR szSrcFileName,LPSTR szDestFileName,LPSTR szSrcDir,LPSTR szDestDir,LPSTR szCurDir,LPSTR szTmpFile,PUINT lpuTmpFileLen); 146 | DWORD WINAPI VerInstallFileW(DWORD uFlags,LPWSTR szSrcFileName,LPWSTR szDestFileName,LPWSTR szSrcDir,LPWSTR szDestDir,LPWSTR szCurDir,LPWSTR szTmpFile,PUINT lpuTmpFileLen); 147 | DWORD WINAPI GetFileVersionInfoSizeA(LPCSTR lptstrFilename,LPDWORD lpdwHandle); 148 | DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR lptstrFilename,LPDWORD lpdwHandle); 149 | WINBOOL WINAPI GetFileVersionInfoA(LPCSTR lptstrFilename,DWORD dwHandle,DWORD dwLen,LPVOID lpData); 150 | WINBOOL WINAPI GetFileVersionInfoW(LPCWSTR lptstrFilename,DWORD dwHandle,DWORD dwLen,LPVOID lpData); 151 | DWORD WINAPI VerLanguageNameA(DWORD wLang,LPSTR szLang,DWORD nSize); 152 | DWORD WINAPI VerLanguageNameW(DWORD wLang,LPWSTR szLang,DWORD nSize); 153 | WINBOOL WINAPI VerQueryValueA(const LPVOID pBlock,LPSTR lpSubBlock,LPVOID *lplpBuffer,PUINT puLen); 154 | WINBOOL WINAPI VerQueryValueW(const LPVOID pBlock,LPWSTR lpSubBlock,LPVOID *lplpBuffer,PUINT puLen); 155 | #endif 156 | 157 | #ifdef __cplusplus 158 | } 159 | #endif 160 | #endif 161 | -------------------------------------------------------------------------------- /include/winapi/basetsd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _BASETSD_H_ 7 | #define _BASETSD_H_ 8 | 9 | #if (defined(__x86_64) || defined(__ia64__)) && !defined(RC_INVOKED) 10 | typedef unsigned __int64 POINTER_64_INT; 11 | #else 12 | typedef unsigned long POINTER_64_INT; 13 | #endif 14 | 15 | #define POINTER_32 16 | #define POINTER_64 17 | #define FIRMWARE_PTR 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef signed char INT8,*PINT8; 24 | typedef signed short INT16,*PINT16; 25 | typedef signed int INT32,*PINT32; 26 | typedef signed __int64 INT64,*PINT64; 27 | typedef unsigned char UINT8,*PUINT8; 28 | typedef unsigned short UINT16,*PUINT16; 29 | typedef unsigned int UINT32,*PUINT32; 30 | typedef unsigned __int64 UINT64,*PUINT64; 31 | typedef signed int LONG32,*PLONG32; 32 | typedef unsigned int ULONG32,*PULONG32; 33 | typedef unsigned int DWORD32,*PDWORD32; 34 | 35 | #ifndef _W64 36 | #define _W64 37 | #endif 38 | 39 | #ifdef _WIN64 40 | typedef __int64 INT_PTR,*PINT_PTR; 41 | typedef unsigned __int64 UINT_PTR,*PUINT_PTR; 42 | typedef __int64 LONG_PTR,*PLONG_PTR; 43 | typedef unsigned __int64 ULONG_PTR,*PULONG_PTR; 44 | #define __int3264 __int64 45 | #else 46 | typedef int INT_PTR,*PINT_PTR; 47 | typedef unsigned int UINT_PTR,*PUINT_PTR; 48 | typedef long LONG_PTR,*PLONG_PTR; 49 | typedef unsigned long ULONG_PTR,*PULONG_PTR; 50 | #define __int3264 __int32 51 | #endif 52 | 53 | #ifdef _WIN64 54 | #define ADDRESS_TAG_BIT 0x40000000000ULL 55 | typedef __int64 SHANDLE_PTR; 56 | typedef unsigned __int64 HANDLE_PTR; 57 | typedef unsigned int UHALF_PTR,*PUHALF_PTR; 58 | typedef int HALF_PTR,*PHALF_PTR; 59 | 60 | static __inline unsigned long HandleToULong(const void *h) { return((unsigned long) (ULONG_PTR) h); } 61 | static __inline long HandleToLong(const void *h) { return((long) (LONG_PTR) h); } 62 | static __inline void *ULongToHandle(const unsigned long h) { return((void *) (UINT_PTR) h); } 63 | static __inline void *LongToHandle(const long h) { return((void *) (INT_PTR) h); } 64 | static __inline unsigned long PtrToUlong(const void *p) { return((unsigned long) (ULONG_PTR) p); } 65 | static __inline unsigned int PtrToUint(const void *p) { return((unsigned int) (UINT_PTR) p); } 66 | static __inline unsigned short PtrToUshort(const void *p) { return((unsigned short) (unsigned long) (ULONG_PTR) p); } 67 | static __inline long PtrToLong(const void *p) { return((long) (LONG_PTR) p); } 68 | static __inline int PtrToInt(const void *p) { return((int) (INT_PTR) p); } 69 | static __inline short PtrToShort(const void *p) { return((short) (long) (LONG_PTR) p); } 70 | static __inline void *IntToPtr(const int i) { return((void *)(INT_PTR)i); } 71 | static __inline void *UIntToPtr(const unsigned int ui) { return((void *)(UINT_PTR)ui); } 72 | static __inline void *LongToPtr(const long l) { return((void *)(LONG_PTR)l); } 73 | static __inline void *ULongToPtr(const unsigned long ul) { return((void *)(ULONG_PTR)ul); } 74 | 75 | #define PtrToPtr64(p) ((void *) p) 76 | #define Ptr64ToPtr(p) ((void *) p) 77 | #define HandleToHandle64(h) (PtrToPtr64(h)) 78 | #define Handle64ToHandle(h) (Ptr64ToPtr(h)) 79 | 80 | static __inline void *Ptr32ToPtr(const void *p) { return (void *)p; } 81 | static __inline void *Handle32ToHandle(const void *h) { return((void *) h); } 82 | static __inline void *PtrToPtr32(const void *p) { return((void *) (ULONG_PTR) p); } 83 | 84 | #define HandleToHandle32(h) (PtrToPtr32(h)) 85 | #else 86 | 87 | #define ADDRESS_TAG_BIT 0x80000000UL 88 | 89 | typedef unsigned short UHALF_PTR,*PUHALF_PTR; 90 | typedef short HALF_PTR,*PHALF_PTR; 91 | typedef long SHANDLE_PTR; 92 | typedef unsigned long HANDLE_PTR; 93 | 94 | #define HandleToULong(h) ((ULONG)(ULONG_PTR)(h)) 95 | #define HandleToLong(h) ((LONG)(LONG_PTR) (h)) 96 | #define ULongToHandle(ul) ((HANDLE)(ULONG_PTR) (ul)) 97 | #define LongToHandle(h) ((HANDLE)(LONG_PTR) (h)) 98 | #define PtrToUlong(p) ((ULONG)(ULONG_PTR) (p)) 99 | #define PtrToLong(p) ((LONG)(LONG_PTR) (p)) 100 | #define PtrToUint(p) ((UINT)(UINT_PTR) (p)) 101 | #define PtrToInt(p) ((INT)(INT_PTR) (p)) 102 | #define PtrToUshort(p) ((unsigned short)(ULONG_PTR)(p)) 103 | #define PtrToShort(p) ((short)(LONG_PTR)(p)) 104 | #define IntToPtr(i) ((VOID *)(INT_PTR)((int)i)) 105 | #define UIntToPtr(ui) ((VOID *)(UINT_PTR)((unsigned int)ui)) 106 | #define LongToPtr(l) ((VOID *)(LONG_PTR)((long)l)) 107 | #define ULongToPtr(ul) ((VOID *)(ULONG_PTR)((unsigned long)ul)) 108 | 109 | static __inline void *PtrToPtr64(const void *p) { return((void *) (ULONG_PTR)p); } 110 | static __inline void *Ptr64ToPtr(const void *p) { return((void *) (ULONG_PTR) p); } 111 | static __inline void *HandleToHandle64(const void *h) { return((void *) h); } 112 | static __inline void *Handle64ToHandle(const void *h) { return((void *) (ULONG_PTR) h); } 113 | 114 | #define Ptr32ToPtr(p) ((void *) p) 115 | #define Handle32ToHandle(h) (Ptr32ToPtr(h)) 116 | #define PtrToPtr32(p) ((void *) p) 117 | #define HandleToHandle32(h) (PtrToPtr32(h)) 118 | #endif 119 | 120 | #define HandleToUlong(h) HandleToULong(h) 121 | #define UlongToHandle(ul) ULongToHandle(ul) 122 | #define UlongToPtr(ul) ULongToPtr(ul) 123 | #define UintToPtr(ui) UIntToPtr(ui) 124 | 125 | #define MAXUINT_PTR (~((UINT_PTR)0)) 126 | #define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1)) 127 | #define MININT_PTR (~MAXINT_PTR) 128 | 129 | #define MAXULONG_PTR (~((ULONG_PTR)0)) 130 | #define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1)) 131 | #define MINLONG_PTR (~MAXLONG_PTR) 132 | 133 | #define MAXUHALF_PTR ((UHALF_PTR)~0) 134 | #define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1)) 135 | #define MINHALF_PTR (~MAXHALF_PTR) 136 | 137 | typedef ULONG_PTR SIZE_T,*PSIZE_T; 138 | typedef LONG_PTR SSIZE_T,*PSSIZE_T; 139 | typedef ULONG_PTR DWORD_PTR,*PDWORD_PTR; 140 | typedef __int64 LONG64,*PLONG64; 141 | typedef unsigned __int64 ULONG64,*PULONG64; 142 | typedef unsigned __int64 DWORD64,*PDWORD64; 143 | typedef ULONG_PTR KAFFINITY; 144 | typedef KAFFINITY *PKAFFINITY; 145 | 146 | #ifdef __cplusplus 147 | } 148 | #endif 149 | #endif 150 | -------------------------------------------------------------------------------- /include/tcc/tcc_libm.h: -------------------------------------------------------------------------------- 1 | #ifndef _TCC_LIBM_H_ 2 | #define _TCC_LIBM_H_ 3 | 4 | #include "../math.h" 5 | 6 | /* TCC uses 8 bytes for double and long double, so effectively the l variants 7 | * are never used. For now, they just run the normal (double) variant. 8 | */ 9 | 10 | /* 11 | * most of the code in this file is taken from MUSL rs-1.0 (MIT license) 12 | * - musl-libc: http://git.musl-libc.org/cgit/musl/tree/src/math?h=rs-1.0 13 | * - License: http://git.musl-libc.org/cgit/musl/tree/COPYRIGHT?h=rs-1.0 14 | */ 15 | 16 | /******************************************************************************* 17 | Start of code based on MUSL 18 | *******************************************************************************/ 19 | /* 20 | musl as a whole is licensed under the following standard MIT license: 21 | 22 | ---------------------------------------------------------------------- 23 | Copyright © 2005-2014 Rich Felker, et al. 24 | 25 | Permission is hereby granted, free of charge, to any person obtaining 26 | a copy of this software and associated documentation files (the 27 | "Software"), to deal in the Software without restriction, including 28 | without limitation the rights to use, copy, modify, merge, publish, 29 | distribute, sublicense, and/or sell copies of the Software, and to 30 | permit persons to whom the Software is furnished to do so, subject to 31 | the following conditions: 32 | 33 | The above copyright notice and this permission notice shall be 34 | included in all copies or substantial portions of the Software. 35 | 36 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 38 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 39 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 40 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 41 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 42 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 43 | ---------------------------------------------------------------------- 44 | */ 45 | 46 | /* fpclassify */ 47 | 48 | __CRT_INLINE int __cdecl __fpclassify (double x) { 49 | union {double f; uint64_t i;} u = {x}; 50 | int e = u.i>>52 & 0x7ff; 51 | if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; 52 | if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE; 53 | return FP_NORMAL; 54 | } 55 | 56 | __CRT_INLINE int __cdecl __fpclassifyf (float x) { 57 | union {float f; uint32_t i;} u = {x}; 58 | int e = u.i>>23 & 0xff; 59 | if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; 60 | if (e==0xff) return u.i<<9 ? FP_NAN : FP_INFINITE; 61 | return FP_NORMAL; 62 | } 63 | 64 | __CRT_INLINE int __cdecl __fpclassifyl (long double x) { 65 | return __fpclassify(x); 66 | } 67 | 68 | 69 | /* signbit */ 70 | 71 | __CRT_INLINE int __cdecl __signbit (double x) { 72 | union {double d; uint64_t i;} y = { x }; 73 | return y.i>>63; 74 | } 75 | 76 | __CRT_INLINE int __cdecl __signbitf (float x) { 77 | union {float f; uint32_t i; } y = { x }; 78 | return y.i>>31; 79 | } 80 | 81 | __CRT_INLINE int __cdecl __signbitl (long double x) { 82 | return __signbit(x); 83 | } 84 | 85 | 86 | /* fmin*, fmax* */ 87 | 88 | #define TCCFP_FMIN_EVAL (isnan(x) ? y : \ 89 | isnan(y) ? x : \ 90 | (signbit(x) != signbit(y)) ? (signbit(x) ? x : y) : \ 91 | x < y ? x : y) 92 | 93 | __CRT_INLINE double __cdecl fmin (double x, double y) { 94 | return TCCFP_FMIN_EVAL; 95 | } 96 | 97 | __CRT_INLINE float __cdecl fminf (float x, float y) { 98 | return TCCFP_FMIN_EVAL; 99 | } 100 | 101 | __CRT_INLINE long double __cdecl fminl (long double x, long double y) { 102 | return TCCFP_FMIN_EVAL; 103 | } 104 | 105 | #define TCCFP_FMAX_EVAL (isnan(x) ? y : \ 106 | isnan(y) ? x : \ 107 | (signbit(x) != signbit(y)) ? (signbit(x) ? y : x) : \ 108 | x < y ? y : x) 109 | 110 | __CRT_INLINE double __cdecl fmax (double x, double y) { 111 | return TCCFP_FMAX_EVAL; 112 | } 113 | 114 | __CRT_INLINE float __cdecl fmaxf (float x, float y) { 115 | return TCCFP_FMAX_EVAL; 116 | } 117 | 118 | __CRT_INLINE long double __cdecl fmaxl (long double x, long double y) { 119 | return TCCFP_FMAX_EVAL; 120 | } 121 | 122 | 123 | /* *round* */ 124 | 125 | #define TCCFP_FORCE_EVAL(x) do { \ 126 | if (sizeof(x) == sizeof(float)) { \ 127 | volatile float __x; \ 128 | __x = (x); \ 129 | } else if (sizeof(x) == sizeof(double)) { \ 130 | volatile double __x; \ 131 | __x = (x); \ 132 | } else { \ 133 | volatile long double __x; \ 134 | __x = (x); \ 135 | } \ 136 | } while(0) 137 | 138 | __CRT_INLINE double __cdecl round (double x) { 139 | union {double f; uint64_t i;} u = {x}; 140 | int e = u.i >> 52 & 0x7ff; 141 | double y; 142 | 143 | if (e >= 0x3ff+52) 144 | return x; 145 | if (u.i >> 63) 146 | x = -x; 147 | if (e < 0x3ff-1) { 148 | /* raise inexact if x!=0 */ 149 | TCCFP_FORCE_EVAL(x + 0x1p52); 150 | return 0*u.f; 151 | } 152 | y = (double)(x + 0x1p52) - 0x1p52 - x; 153 | if (y > 0.5) 154 | y = y + x - 1; 155 | else if (y <= -0.5) 156 | y = y + x + 1; 157 | else 158 | y = y + x; 159 | if (u.i >> 63) 160 | y = -y; 161 | return y; 162 | } 163 | 164 | __CRT_INLINE long __cdecl lround (double x) { 165 | return round(x); 166 | } 167 | 168 | __CRT_INLINE long long __cdecl llround (double x) { 169 | return round(x); 170 | } 171 | 172 | __CRT_INLINE float __cdecl roundf (float x) { 173 | return round(x); 174 | } 175 | 176 | __CRT_INLINE long __cdecl lroundf (float x) { 177 | return round(x); 178 | } 179 | 180 | __CRT_INLINE long long __cdecl llroundf (float x) { 181 | return round(x); 182 | } 183 | 184 | __CRT_INLINE long double __cdecl roundl (long double x) { 185 | return round(x); 186 | } 187 | 188 | __CRT_INLINE long __cdecl lroundl (long double x) { 189 | return round(x); 190 | } 191 | 192 | __CRT_INLINE long long __cdecl llroundl (long double x) { 193 | return round(x); 194 | } 195 | 196 | 197 | /******************************************************************************* 198 | End of code based on MUSL 199 | *******************************************************************************/ 200 | 201 | #endif /* _TCC_LIBM_H_ */ 202 | -------------------------------------------------------------------------------- /lib/gdi32.def: -------------------------------------------------------------------------------- 1 | LIBRARY gdi32.dll 2 | 3 | EXPORTS 4 | AbortDoc 5 | AbortPath 6 | AddFontResourceA 7 | AddFontResourceW 8 | AngleArc 9 | AnimatePalette 10 | Arc 11 | ArcTo 12 | BeginPath 13 | BitBlt 14 | ByeByeGDI 15 | CancelDC 16 | CheckColorsInGamut 17 | ChoosePixelFormat 18 | Chord 19 | CloseEnhMetaFile 20 | CloseFigure 21 | CloseMetaFile 22 | ColorCorrectPalette 23 | ColorMatchToTarget 24 | CombineRgn 25 | CombineTransform 26 | CopyEnhMetaFileA 27 | CopyEnhMetaFileW 28 | CopyMetaFileA 29 | CopyMetaFileW 30 | CreateBitmap 31 | CreateBitmapIndirect 32 | CreateBrushIndirect 33 | CreateColorSpaceA 34 | CreateColorSpaceW 35 | CreateCompatibleBitmap 36 | CreateCompatibleDC 37 | CreateDCA 38 | CreateDCW 39 | CreateDIBPatternBrush 40 | CreateDIBPatternBrushPt 41 | CreateDIBSection 42 | CreateDIBitmap 43 | CreateDiscardableBitmap 44 | CreateEllipticRgn 45 | CreateEllipticRgnIndirect 46 | CreateEnhMetaFileA 47 | CreateEnhMetaFileW 48 | CreateFontA 49 | CreateFontIndirectA 50 | CreateFontIndirectW 51 | CreateFontW 52 | CreateHalftonePalette 53 | CreateHatchBrush 54 | CreateICA 55 | CreateICW 56 | CreateMetaFileA 57 | CreateMetaFileW 58 | CreatePalette 59 | CreatePatternBrush 60 | CreatePen 61 | CreatePenIndirect 62 | CreatePolyPolygonRgn 63 | CreatePolygonRgn 64 | CreateRectRgn 65 | CreateRectRgnIndirect 66 | CreateRoundRectRgn 67 | CreateScalableFontResourceA 68 | CreateScalableFontResourceW 69 | CreateSolidBrush 70 | DPtoLP 71 | DeleteColorSpace 72 | DeleteDC 73 | DeleteEnhMetaFile 74 | DeleteMetaFile 75 | DeleteObject 76 | DescribePixelFormat 77 | DeviceCapabilitiesEx 78 | DeviceCapabilitiesExA 79 | DeviceCapabilitiesExW 80 | DrawEscape 81 | Ellipse 82 | EnableEUDC 83 | EndDoc 84 | EndPage 85 | EndPath 86 | EnumEnhMetaFile 87 | EnumFontFamiliesA 88 | EnumFontFamiliesExA 89 | EnumFontFamiliesExW 90 | EnumFontFamiliesW 91 | EnumFontsA 92 | EnumFontsW 93 | EnumICMProfilesA 94 | EnumICMProfilesW 95 | EnumMetaFile 96 | EnumObjects 97 | EqualRgn 98 | Escape 99 | ExcludeClipRect 100 | ExtCreatePen 101 | ExtCreateRegion 102 | ExtEscape 103 | ExtFloodFill 104 | ExtSelectClipRgn 105 | ExtTextOutA 106 | ExtTextOutW 107 | FillPath 108 | FillRgn 109 | FixBrushOrgEx 110 | FlattenPath 111 | FloodFill 112 | FrameRgn 113 | GdiComment 114 | GdiFlush 115 | GdiGetBatchLimit 116 | GdiPlayDCScript 117 | GdiPlayJournal 118 | GdiPlayScript 119 | GdiSetBatchLimit 120 | GetArcDirection 121 | GetAspectRatioFilterEx 122 | GetBitmapBits 123 | GetBitmapDimensionEx 124 | GetBkColor 125 | GetBkMode 126 | GetBoundsRect 127 | GetBrushOrgEx 128 | GetCharABCWidthsA 129 | GetCharABCWidthsFloatA 130 | GetCharABCWidthsFloatW 131 | GetCharABCWidthsW 132 | GetCharWidth32A 133 | GetCharWidth32W 134 | GetCharWidthA 135 | GetCharWidthFloatA 136 | GetCharWidthFloatW 137 | GetCharWidthW 138 | GetCharacterPlacementA 139 | GetCharacterPlacementW 140 | GetClipBox 141 | GetClipRgn 142 | GetColorAdjustment 143 | GetColorSpace 144 | GetCurrentObject 145 | GetCurrentPositionEx 146 | GetDCOrgEx 147 | GetDIBColorTable 148 | GetDIBits 149 | GetDeviceCaps 150 | GetDeviceGammaRamp 151 | GetEnhMetaFileA 152 | GetEnhMetaFileBits 153 | GetEnhMetaFileDescriptionA 154 | GetEnhMetaFileDescriptionW 155 | GetEnhMetaFileHeader 156 | GetEnhMetaFilePaletteEntries 157 | GetEnhMetaFileW 158 | GetFontData 159 | GetFontLanguageInfo 160 | GetFontResourceInfo 161 | GetGlyphOutline 162 | GetGlyphOutlineA 163 | GetGlyphOutlineW 164 | GetGraphicsMode 165 | GetICMProfileA 166 | GetICMProfileW 167 | GetKerningPairs 168 | GetKerningPairsA 169 | GetKerningPairsW 170 | GetLayout 171 | GetLogColorSpaceA 172 | GetLogColorSpaceW 173 | GetMapMode 174 | GetMetaFileA 175 | GetMetaFileBitsEx 176 | GetMetaFileW 177 | GetMetaRgn 178 | GetMiterLimit 179 | GetNearestColor 180 | GetNearestPaletteIndex 181 | GetObjectA 182 | GetObjectType 183 | GetObjectW 184 | GetOutlineTextMetricsA 185 | GetOutlineTextMetricsW 186 | GetPaletteEntries 187 | GetPath 188 | GetPixel 189 | GetPixelFormat 190 | GetPolyFillMode 191 | GetROP2 192 | GetRandomRgn 193 | GetRasterizerCaps 194 | GetRegionData 195 | GetRgnBox 196 | GetStockObject 197 | GetStretchBltMode 198 | GetSystemPaletteEntries 199 | GetSystemPaletteUse 200 | GetTextAlign 201 | GetTextCharacterExtra 202 | GetTextCharset 203 | GetTextCharsetInfo 204 | GetTextColor 205 | GetTextExtentExPointA 206 | GetTextExtentExPointW 207 | GetTextExtentPoint32A 208 | GetTextExtentPoint32W 209 | GetTextExtentPointA 210 | GetTextExtentPointW 211 | GetTextFaceA 212 | GetTextFaceW 213 | GetTextMetricsA 214 | GetTextMetricsW 215 | GetViewportExtEx 216 | GetViewportOrgEx 217 | GetWinMetaFileBits 218 | GetWindowExtEx 219 | GetWindowOrgEx 220 | GetWorldTransform 221 | IntersectClipRect 222 | InvertRgn 223 | LPtoDP 224 | LineDDA 225 | LineTo 226 | MaskBlt 227 | ModifyWorldTransform 228 | MoveToEx 229 | OffsetClipRgn 230 | OffsetRgn 231 | OffsetViewportOrgEx 232 | OffsetWindowOrgEx 233 | PaintRgn 234 | PatBlt 235 | PathToRegion 236 | Pie 237 | PlayEnhMetaFile 238 | PlayEnhMetaFileRecord 239 | PlayMetaFile 240 | PlayMetaFileRecord 241 | PlgBlt 242 | PolyBezier 243 | PolyBezierTo 244 | PolyDraw 245 | PolyPolygon 246 | PolyPolyline 247 | PolyTextOutA 248 | PolyTextOutW 249 | Polygon 250 | Polyline 251 | PolylineTo 252 | PtInRegion 253 | PtVisible 254 | RealizePalette 255 | RectInRegion 256 | RectVisible 257 | Rectangle 258 | RemoveFontResourceA 259 | RemoveFontResourceW 260 | ResetDCA 261 | ResetDCW 262 | ResizePalette 263 | RestoreDC 264 | RoundRect 265 | SaveDC 266 | ScaleViewportExtEx 267 | ScaleWindowExtEx 268 | SelectClipPath 269 | SelectClipRgn 270 | SelectObject 271 | SelectPalette 272 | SetAbortProc 273 | SetArcDirection 274 | SetBitmapBits 275 | SetBitmapDimensionEx 276 | SetBkColor 277 | SetBkMode 278 | SetBoundsRect 279 | SetBrushOrgEx 280 | SetColorAdjustment 281 | SetColorSpace 282 | SetDIBColorTable 283 | SetDIBits 284 | SetDIBitsToDevice 285 | SetDeviceGammaRamp 286 | SetEnhMetaFileBits 287 | SetFontEnumeration 288 | SetGraphicsMode 289 | SetICMMode 290 | SetICMProfileA 291 | SetICMProfileW 292 | SetLayout 293 | SetMagicColors 294 | SetMapMode 295 | SetMapperFlags 296 | SetMetaFileBitsEx 297 | SetMetaRgn 298 | SetMiterLimit 299 | SetObjectOwner 300 | SetPaletteEntries 301 | SetPixel 302 | SetPixelFormat 303 | SetPixelV 304 | SetPolyFillMode 305 | SetROP2 306 | SetRectRgn 307 | SetStretchBltMode 308 | SetSystemPaletteUse 309 | SetTextAlign 310 | SetTextCharacterExtra 311 | SetTextColor 312 | SetTextJustification 313 | SetViewportExtEx 314 | SetViewportOrgEx 315 | SetWinMetaFileBits 316 | SetWindowExtEx 317 | SetWindowOrgEx 318 | SetWorldTransform 319 | StartDocA 320 | StartDocW 321 | StartPage 322 | StretchBlt 323 | StretchDIBits 324 | StrokeAndFillPath 325 | StrokePath 326 | SwapBuffers 327 | TextOutA 328 | TextOutW 329 | TranslateCharsetInfo 330 | UnrealizeObject 331 | UpdateColors 332 | UpdateICMRegKeyA 333 | UpdateICMRegKeyW 334 | WidenPath 335 | gdiPlaySpoolStream 336 | pfnRealizePalette 337 | pfnSelectPalette 338 | -------------------------------------------------------------------------------- /include/winapi/windef.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _WINDEF_ 7 | #define _WINDEF_ 8 | 9 | #ifndef STRICT 10 | #define STRICT 1 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifndef WINVER 18 | #define WINVER 0x0502 19 | #endif 20 | 21 | #ifndef BASETYPES 22 | #define BASETYPES 23 | typedef unsigned long ULONG; 24 | typedef ULONG *PULONG; 25 | typedef unsigned short USHORT; 26 | typedef USHORT *PUSHORT; 27 | typedef unsigned char UCHAR; 28 | typedef UCHAR *PUCHAR; 29 | typedef char *PSZ; 30 | #endif 31 | 32 | #define MAX_PATH 260 33 | 34 | #ifndef NULL 35 | #ifdef __cplusplus 36 | #define NULL 0 37 | #else 38 | #define NULL ((void *)0) 39 | #endif 40 | #endif 41 | 42 | #ifndef FALSE 43 | #define FALSE 0 44 | #endif 45 | 46 | #ifndef TRUE 47 | #define TRUE 1 48 | #endif 49 | 50 | #ifndef IN 51 | #define IN 52 | #endif 53 | 54 | #ifndef OUT 55 | #define OUT 56 | #endif 57 | 58 | #ifndef OPTIONAL 59 | #define OPTIONAL 60 | #endif 61 | 62 | #undef far 63 | #undef near 64 | #undef pascal 65 | 66 | #define far 67 | #define near 68 | #define pascal __stdcall 69 | 70 | #define cdecl 71 | #ifndef CDECL 72 | #define CDECL 73 | #endif 74 | #ifndef CALLBACK 75 | #define CALLBACK __stdcall 76 | #endif 77 | #ifndef WINAPI 78 | #define WINAPI __stdcall 79 | #endif 80 | #define WINAPIV __cdecl 81 | #define APIENTRY WINAPI 82 | #define APIPRIVATE WINAPI 83 | #define PASCAL WINAPI 84 | #define WINAPI_INLINE WINAPI 85 | 86 | #undef FAR 87 | #undef NEAR 88 | #define FAR 89 | #define NEAR 90 | #ifndef CONST 91 | #define CONST const 92 | #endif 93 | 94 | typedef unsigned long DWORD; 95 | typedef int WINBOOL; 96 | #define BOOL WINBOOL 97 | typedef unsigned char BYTE; 98 | typedef unsigned short WORD; 99 | typedef float FLOAT; 100 | typedef FLOAT *PFLOAT; 101 | typedef WINBOOL *PBOOL; 102 | typedef WINBOOL *LPBOOL; 103 | typedef BYTE *PBYTE; 104 | typedef BYTE *LPBYTE; 105 | typedef int *PINT; 106 | typedef int *LPINT; 107 | typedef WORD *PWORD; 108 | typedef WORD *LPWORD; 109 | typedef long *LPLONG; 110 | typedef DWORD *PDWORD; 111 | typedef DWORD *LPDWORD; 112 | typedef void *LPVOID; 113 | # ifndef _LPCVOID_DEFINED 114 | #define _LPCVOID_DEFINED 115 | typedef CONST void *LPCVOID; 116 | #endif 117 | typedef int INT; 118 | typedef unsigned int UINT; 119 | typedef unsigned int *PUINT; 120 | 121 | #ifndef NT_INCLUDED 122 | #include 123 | #endif 124 | 125 | //gr #include 126 | 127 | typedef UINT_PTR WPARAM; 128 | typedef LONG_PTR LPARAM; 129 | typedef LONG_PTR LRESULT; 130 | 131 | #ifndef __cplusplus 132 | #ifndef NOMINMAX 133 | #ifndef max 134 | #define max(a,b) (((a) > (b)) ? (a) : (b)) 135 | #endif 136 | 137 | #ifndef min 138 | #define min(a,b) (((a) < (b)) ? (a) : (b)) 139 | #endif 140 | #endif 141 | #endif 142 | 143 | #define MAKEWORD(a,b) ((WORD)(((BYTE)((DWORD_PTR)(a) & 0xff)) | ((WORD)((BYTE)((DWORD_PTR)(b) & 0xff))) << 8)) 144 | #define MAKELONG(a,b) ((LONG)(((WORD)((DWORD_PTR)(a) & 0xffff)) | ((DWORD)((WORD)((DWORD_PTR)(b) & 0xffff))) << 16)) 145 | #define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff)) 146 | #define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16)) 147 | #define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xff)) 148 | #define HIBYTE(w) ((BYTE)((DWORD_PTR)(w) >> 8)) 149 | 150 | #ifndef WIN_INTERNAL 151 | DECLARE_HANDLE (HWND); 152 | DECLARE_HANDLE (HHOOK); 153 | #ifdef WINABLE 154 | DECLARE_HANDLE (HEVENT); 155 | #endif 156 | #endif 157 | 158 | typedef WORD ATOM; 159 | 160 | typedef HANDLE *SPHANDLE; 161 | typedef HANDLE *LPHANDLE; 162 | typedef HANDLE HGLOBAL; 163 | typedef HANDLE HLOCAL; 164 | typedef HANDLE GLOBALHANDLE; 165 | typedef HANDLE LOCALHANDLE; 166 | #ifdef _WIN64 167 | typedef INT_PTR (WINAPI *FARPROC)(); 168 | typedef INT_PTR (WINAPI *NEARPROC)(); 169 | typedef INT_PTR (WINAPI *PROC)(); 170 | #else 171 | typedef int (WINAPI *FARPROC)(); 172 | typedef int (WINAPI *NEARPROC)(); 173 | typedef int (WINAPI *PROC)(); 174 | #endif 175 | 176 | typedef void *HGDIOBJ; 177 | 178 | DECLARE_HANDLE(HKEY); 179 | typedef HKEY *PHKEY; 180 | 181 | DECLARE_HANDLE(HACCEL); 182 | DECLARE_HANDLE(HBITMAP); 183 | DECLARE_HANDLE(HBRUSH); 184 | DECLARE_HANDLE(HCOLORSPACE); 185 | DECLARE_HANDLE(HDC); 186 | DECLARE_HANDLE(HGLRC); 187 | DECLARE_HANDLE(HDESK); 188 | DECLARE_HANDLE(HENHMETAFILE); 189 | DECLARE_HANDLE(HFONT); 190 | DECLARE_HANDLE(HICON); 191 | DECLARE_HANDLE(HMENU); 192 | DECLARE_HANDLE(HMETAFILE); 193 | DECLARE_HANDLE(HINSTANCE); 194 | typedef HINSTANCE HMODULE; 195 | DECLARE_HANDLE(HPALETTE); 196 | DECLARE_HANDLE(HPEN); 197 | DECLARE_HANDLE(HRGN); 198 | DECLARE_HANDLE(HRSRC); 199 | DECLARE_HANDLE(HSTR); 200 | DECLARE_HANDLE(HTASK); 201 | DECLARE_HANDLE(HWINSTA); 202 | DECLARE_HANDLE(HKL); 203 | DECLARE_HANDLE(HMONITOR); 204 | DECLARE_HANDLE(HWINEVENTHOOK); 205 | DECLARE_HANDLE(HUMPD); 206 | 207 | typedef int HFILE; 208 | typedef HICON HCURSOR; 209 | typedef DWORD COLORREF; 210 | typedef DWORD *LPCOLORREF; 211 | 212 | #define HFILE_ERROR ((HFILE)-1) 213 | 214 | typedef struct tagRECT { 215 | LONG left; 216 | LONG top; 217 | LONG right; 218 | LONG bottom; 219 | } RECT,*PRECT,*NPRECT,*LPRECT; 220 | 221 | typedef const RECT *LPCRECT; 222 | 223 | typedef struct _RECTL { 224 | LONG left; 225 | LONG top; 226 | LONG right; 227 | LONG bottom; 228 | } RECTL,*PRECTL,*LPRECTL; 229 | 230 | typedef const RECTL *LPCRECTL; 231 | 232 | typedef struct tagPOINT { 233 | LONG x; 234 | LONG y; 235 | } POINT,*PPOINT,*NPPOINT,*LPPOINT; 236 | 237 | typedef struct _POINTL { 238 | LONG x; 239 | LONG y; 240 | } POINTL,*PPOINTL; 241 | 242 | typedef struct tagSIZE { 243 | LONG cx; 244 | LONG cy; 245 | } SIZE,*PSIZE,*LPSIZE; 246 | 247 | typedef SIZE SIZEL; 248 | typedef SIZE *PSIZEL,*LPSIZEL; 249 | 250 | typedef struct tagPOINTS { 251 | SHORT x; 252 | SHORT y; 253 | } POINTS,*PPOINTS,*LPPOINTS; 254 | 255 | typedef struct _FILETIME { 256 | DWORD dwLowDateTime; 257 | DWORD dwHighDateTime; 258 | } FILETIME,*PFILETIME,*LPFILETIME; 259 | #define _FILETIME_ 260 | 261 | #define DM_UPDATE 1 262 | #define DM_COPY 2 263 | #define DM_PROMPT 4 264 | #define DM_MODIFY 8 265 | 266 | #define DM_IN_BUFFER DM_MODIFY 267 | #define DM_IN_PROMPT DM_PROMPT 268 | #define DM_OUT_BUFFER DM_COPY 269 | #define DM_OUT_DEFAULT DM_UPDATE 270 | 271 | #define DC_FIELDS 1 272 | #define DC_PAPERS 2 273 | #define DC_PAPERSIZE 3 274 | #define DC_MINEXTENT 4 275 | #define DC_MAXEXTENT 5 276 | #define DC_BINS 6 277 | #define DC_DUPLEX 7 278 | #define DC_SIZE 8 279 | #define DC_EXTRA 9 280 | #define DC_VERSION 10 281 | #define DC_DRIVER 11 282 | #define DC_BINNAMES 12 283 | #define DC_ENUMRESOLUTIONS 13 284 | #define DC_FILEDEPENDENCIES 14 285 | #define DC_TRUETYPE 15 286 | #define DC_PAPERNAMES 16 287 | #define DC_ORIENTATION 17 288 | #define DC_COPIES 18 289 | 290 | #ifdef __cplusplus 291 | } 292 | #endif 293 | #endif 294 | -------------------------------------------------------------------------------- /include/stdint.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* ISO C9x 7.18 Integer types 7 | * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) 8 | * 9 | * THIS SOFTWARE IS NOT COPYRIGHTED 10 | * 11 | * Contributor: Danny Smith 12 | * 13 | * This source code is offered for use in the public domain. You may 14 | * use, modify or distribute it freely. 15 | * 16 | * This code is distributed in the hope that it will be useful but 17 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 18 | * DISCLAIMED. This includes but is not limited to warranties of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 20 | * 21 | * Date: 2000-12-02 22 | */ 23 | 24 | 25 | #ifndef _STDINT_H 26 | #define _STDINT_H 27 | 28 | #include <_mingw.h> 29 | 30 | #define __need_wint_t 31 | #define __need_wchar_t 32 | #include "stddef.h" 33 | 34 | #ifndef __int8_t_defined 35 | #define __int8_t_defined 36 | /* 7.18.1.1 Exact-width integer types */ 37 | typedef signed char int8_t; 38 | typedef unsigned char uint8_t; 39 | typedef short int16_t; 40 | typedef unsigned short uint16_t; 41 | typedef int int32_t; 42 | typedef unsigned uint32_t; 43 | typedef long long int64_t; 44 | typedef unsigned long long uint64_t; 45 | #endif 46 | 47 | /* 7.18.1.2 Minimum-width integer types */ 48 | typedef signed char int_least8_t; 49 | typedef unsigned char uint_least8_t; 50 | typedef short int_least16_t; 51 | typedef unsigned short uint_least16_t; 52 | typedef int int_least32_t; 53 | typedef unsigned uint_least32_t; 54 | typedef long long int_least64_t; 55 | typedef unsigned long long uint_least64_t; 56 | 57 | /* 7.18.1.3 Fastest minimum-width integer types 58 | * Not actually guaranteed to be fastest for all purposes 59 | * Here we use the exact-width types for 8 and 16-bit ints. 60 | */ 61 | typedef char int_fast8_t; 62 | typedef unsigned char uint_fast8_t; 63 | typedef short int_fast16_t; 64 | typedef unsigned short uint_fast16_t; 65 | typedef int int_fast32_t; 66 | typedef unsigned int uint_fast32_t; 67 | typedef long long int_fast64_t; 68 | typedef unsigned long long uint_fast64_t; 69 | 70 | /* 7.18.1.5 Greatest-width integer types */ 71 | typedef long long intmax_t; 72 | typedef unsigned long long uintmax_t; 73 | 74 | /* 7.18.2 Limits of specified-width integer types */ 75 | #if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) 76 | 77 | /* 7.18.2.1 Limits of exact-width integer types */ 78 | #define INT8_MIN (-128) 79 | #define INT16_MIN (-32768) 80 | #define INT32_MIN (-2147483647 - 1) 81 | #define INT64_MIN (-9223372036854775807LL - 1) 82 | 83 | #define INT8_MAX 127 84 | #define INT16_MAX 32767 85 | #define INT32_MAX 2147483647 86 | #define INT64_MAX 9223372036854775807LL 87 | 88 | #define UINT8_MAX 0xff /* 255U */ 89 | #define UINT16_MAX 0xffff /* 65535U */ 90 | #define UINT32_MAX 0xffffffff /* 4294967295U */ 91 | #define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ 92 | 93 | /* 7.18.2.2 Limits of minimum-width integer types */ 94 | #define INT_LEAST8_MIN INT8_MIN 95 | #define INT_LEAST16_MIN INT16_MIN 96 | #define INT_LEAST32_MIN INT32_MIN 97 | #define INT_LEAST64_MIN INT64_MIN 98 | 99 | #define INT_LEAST8_MAX INT8_MAX 100 | #define INT_LEAST16_MAX INT16_MAX 101 | #define INT_LEAST32_MAX INT32_MAX 102 | #define INT_LEAST64_MAX INT64_MAX 103 | 104 | #define UINT_LEAST8_MAX UINT8_MAX 105 | #define UINT_LEAST16_MAX UINT16_MAX 106 | #define UINT_LEAST32_MAX UINT32_MAX 107 | #define UINT_LEAST64_MAX UINT64_MAX 108 | 109 | /* 7.18.2.3 Limits of fastest minimum-width integer types */ 110 | #define INT_FAST8_MIN INT8_MIN 111 | #define INT_FAST16_MIN INT16_MIN 112 | #define INT_FAST32_MIN INT32_MIN 113 | #define INT_FAST64_MIN INT64_MIN 114 | 115 | #define INT_FAST8_MAX INT8_MAX 116 | #define INT_FAST16_MAX INT16_MAX 117 | #define INT_FAST32_MAX INT32_MAX 118 | #define INT_FAST64_MAX INT64_MAX 119 | 120 | #define UINT_FAST8_MAX UINT8_MAX 121 | #define UINT_FAST16_MAX UINT16_MAX 122 | #define UINT_FAST32_MAX UINT32_MAX 123 | #define UINT_FAST64_MAX UINT64_MAX 124 | 125 | /* 7.18.2.4 Limits of integer types capable of holding 126 | object pointers */ 127 | #ifdef _WIN64 128 | #define INTPTR_MIN INT64_MIN 129 | #define INTPTR_MAX INT64_MAX 130 | #define UINTPTR_MAX UINT64_MAX 131 | #else 132 | #define INTPTR_MIN INT32_MIN 133 | #define INTPTR_MAX INT32_MAX 134 | #define UINTPTR_MAX UINT32_MAX 135 | #endif 136 | 137 | /* 7.18.2.5 Limits of greatest-width integer types */ 138 | #define INTMAX_MIN INT64_MIN 139 | #define INTMAX_MAX INT64_MAX 140 | #define UINTMAX_MAX UINT64_MAX 141 | 142 | /* 7.18.3 Limits of other integer types */ 143 | #ifdef _WIN64 144 | #define PTRDIFF_MIN INT64_MIN 145 | #define PTRDIFF_MAX INT64_MAX 146 | #else 147 | #define PTRDIFF_MIN INT32_MIN 148 | #define PTRDIFF_MAX INT32_MAX 149 | #endif 150 | 151 | #define SIG_ATOMIC_MIN INT32_MIN 152 | #define SIG_ATOMIC_MAX INT32_MAX 153 | 154 | #ifndef SIZE_MAX 155 | #ifdef _WIN64 156 | #define SIZE_MAX UINT64_MAX 157 | #else 158 | #define SIZE_MAX UINT32_MAX 159 | #endif 160 | #endif 161 | 162 | #ifndef WCHAR_MIN /* also in wchar.h */ 163 | #define WCHAR_MIN 0 164 | #define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */ 165 | #endif 166 | 167 | /* 168 | * wint_t is unsigned short for compatibility with MS runtime 169 | */ 170 | #define WINT_MIN 0 171 | #define WINT_MAX ((wint_t)-1) /* UINT16_MAX */ 172 | 173 | #endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ 174 | 175 | 176 | /* 7.18.4 Macros for integer constants */ 177 | #if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) 178 | 179 | /* 7.18.4.1 Macros for minimum-width integer constants 180 | 181 | According to Douglas Gwyn : 182 | "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC 183 | 9899:1999 as initially published, the expansion was required 184 | to be an integer constant of precisely matching type, which 185 | is impossible to accomplish for the shorter types on most 186 | platforms, because C99 provides no standard way to designate 187 | an integer constant with width less than that of type int. 188 | TC1 changed this to require just an integer constant 189 | *expression* with *promoted* type." 190 | 191 | The trick used here is from Clive D W Feather. 192 | */ 193 | 194 | #define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val)) 195 | #define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val)) 196 | #define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val)) 197 | /* The 'trick' doesn't work in C89 for long long because, without 198 | suffix, (val) will be evaluated as int, not intmax_t */ 199 | #define INT64_C(val) val##LL 200 | 201 | #define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val)) 202 | #define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val)) 203 | #define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val)) 204 | #define UINT64_C(val) val##ULL 205 | 206 | /* 7.18.4.2 Macros for greatest-width integer constants */ 207 | #define INTMAX_C(val) val##LL 208 | #define UINTMAX_C(val) val##ULL 209 | 210 | #endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ 211 | 212 | #endif 213 | -------------------------------------------------------------------------------- /include/inttypes.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7.8 Format conversion of integer types */ 7 | 8 | #ifndef _INTTYPES_H_ 9 | #define _INTTYPES_H_ 10 | 11 | #include <_mingw.h> 12 | #include 13 | #define __need_wchar_t 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | typedef struct { 21 | intmax_t quot; 22 | intmax_t rem; 23 | } imaxdiv_t; 24 | 25 | #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) 26 | 27 | /* 7.8.1 Macros for format specifiers 28 | * 29 | * MS runtime does not yet understand C9x standard "ll" 30 | * length specifier. It appears to treat "ll" as "l". 31 | * The non-standard I64 length specifier causes warning in GCC, 32 | * but understood by MS runtime functions. 33 | */ 34 | 35 | /* fprintf macros for signed types */ 36 | #define PRId8 "d" 37 | #define PRId16 "d" 38 | #define PRId32 "d" 39 | #define PRId64 "I64d" 40 | 41 | #define PRIdLEAST8 "d" 42 | #define PRIdLEAST16 "d" 43 | #define PRIdLEAST32 "d" 44 | #define PRIdLEAST64 "I64d" 45 | 46 | #define PRIdFAST8 "d" 47 | #define PRIdFAST16 "d" 48 | #define PRIdFAST32 "d" 49 | #define PRIdFAST64 "I64d" 50 | 51 | #define PRIdMAX "I64d" 52 | 53 | #define PRIi8 "i" 54 | #define PRIi16 "i" 55 | #define PRIi32 "i" 56 | #define PRIi64 "I64i" 57 | 58 | #define PRIiLEAST8 "i" 59 | #define PRIiLEAST16 "i" 60 | #define PRIiLEAST32 "i" 61 | #define PRIiLEAST64 "I64i" 62 | 63 | #define PRIiFAST8 "i" 64 | #define PRIiFAST16 "i" 65 | #define PRIiFAST32 "i" 66 | #define PRIiFAST64 "I64i" 67 | 68 | #define PRIiMAX "I64i" 69 | 70 | #define PRIo8 "o" 71 | #define PRIo16 "o" 72 | #define PRIo32 "o" 73 | #define PRIo64 "I64o" 74 | 75 | #define PRIoLEAST8 "o" 76 | #define PRIoLEAST16 "o" 77 | #define PRIoLEAST32 "o" 78 | #define PRIoLEAST64 "I64o" 79 | 80 | #define PRIoFAST8 "o" 81 | #define PRIoFAST16 "o" 82 | #define PRIoFAST32 "o" 83 | #define PRIoFAST64 "I64o" 84 | 85 | #define PRIoMAX "I64o" 86 | 87 | /* fprintf macros for unsigned types */ 88 | #define PRIu8 "u" 89 | #define PRIu16 "u" 90 | #define PRIu32 "u" 91 | #define PRIu64 "I64u" 92 | 93 | 94 | #define PRIuLEAST8 "u" 95 | #define PRIuLEAST16 "u" 96 | #define PRIuLEAST32 "u" 97 | #define PRIuLEAST64 "I64u" 98 | 99 | #define PRIuFAST8 "u" 100 | #define PRIuFAST16 "u" 101 | #define PRIuFAST32 "u" 102 | #define PRIuFAST64 "I64u" 103 | 104 | #define PRIuMAX "I64u" 105 | 106 | #define PRIx8 "x" 107 | #define PRIx16 "x" 108 | #define PRIx32 "x" 109 | #define PRIx64 "I64x" 110 | 111 | #define PRIxLEAST8 "x" 112 | #define PRIxLEAST16 "x" 113 | #define PRIxLEAST32 "x" 114 | #define PRIxLEAST64 "I64x" 115 | 116 | #define PRIxFAST8 "x" 117 | #define PRIxFAST16 "x" 118 | #define PRIxFAST32 "x" 119 | #define PRIxFAST64 "I64x" 120 | 121 | #define PRIxMAX "I64x" 122 | 123 | #define PRIX8 "X" 124 | #define PRIX16 "X" 125 | #define PRIX32 "X" 126 | #define PRIX64 "I64X" 127 | 128 | #define PRIXLEAST8 "X" 129 | #define PRIXLEAST16 "X" 130 | #define PRIXLEAST32 "X" 131 | #define PRIXLEAST64 "I64X" 132 | 133 | #define PRIXFAST8 "X" 134 | #define PRIXFAST16 "X" 135 | #define PRIXFAST32 "X" 136 | #define PRIXFAST64 "I64X" 137 | 138 | #define PRIXMAX "I64X" 139 | 140 | /* 141 | * fscanf macros for signed int types 142 | * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t 143 | * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have 144 | * no length identifiers 145 | */ 146 | 147 | #define SCNd16 "hd" 148 | #define SCNd32 "d" 149 | #define SCNd64 "I64d" 150 | 151 | #define SCNdLEAST16 "hd" 152 | #define SCNdLEAST32 "d" 153 | #define SCNdLEAST64 "I64d" 154 | 155 | #define SCNdFAST16 "hd" 156 | #define SCNdFAST32 "d" 157 | #define SCNdFAST64 "I64d" 158 | 159 | #define SCNdMAX "I64d" 160 | 161 | #define SCNi16 "hi" 162 | #define SCNi32 "i" 163 | #define SCNi64 "I64i" 164 | 165 | #define SCNiLEAST16 "hi" 166 | #define SCNiLEAST32 "i" 167 | #define SCNiLEAST64 "I64i" 168 | 169 | #define SCNiFAST16 "hi" 170 | #define SCNiFAST32 "i" 171 | #define SCNiFAST64 "I64i" 172 | 173 | #define SCNiMAX "I64i" 174 | 175 | #define SCNo16 "ho" 176 | #define SCNo32 "o" 177 | #define SCNo64 "I64o" 178 | 179 | #define SCNoLEAST16 "ho" 180 | #define SCNoLEAST32 "o" 181 | #define SCNoLEAST64 "I64o" 182 | 183 | #define SCNoFAST16 "ho" 184 | #define SCNoFAST32 "o" 185 | #define SCNoFAST64 "I64o" 186 | 187 | #define SCNoMAX "I64o" 188 | 189 | #define SCNx16 "hx" 190 | #define SCNx32 "x" 191 | #define SCNx64 "I64x" 192 | 193 | #define SCNxLEAST16 "hx" 194 | #define SCNxLEAST32 "x" 195 | #define SCNxLEAST64 "I64x" 196 | 197 | #define SCNxFAST16 "hx" 198 | #define SCNxFAST32 "x" 199 | #define SCNxFAST64 "I64x" 200 | 201 | #define SCNxMAX "I64x" 202 | 203 | /* fscanf macros for unsigned int types */ 204 | 205 | #define SCNu16 "hu" 206 | #define SCNu32 "u" 207 | #define SCNu64 "I64u" 208 | 209 | #define SCNuLEAST16 "hu" 210 | #define SCNuLEAST32 "u" 211 | #define SCNuLEAST64 "I64u" 212 | 213 | #define SCNuFAST16 "hu" 214 | #define SCNuFAST32 "u" 215 | #define SCNuFAST64 "I64u" 216 | 217 | #define SCNuMAX "I64u" 218 | 219 | #ifdef _WIN64 220 | #define PRIdPTR "I64d" 221 | #define PRIiPTR "I64i" 222 | #define PRIoPTR "I64o" 223 | #define PRIuPTR "I64u" 224 | #define PRIxPTR "I64x" 225 | #define PRIXPTR "I64X" 226 | #define SCNdPTR "I64d" 227 | #define SCNiPTR "I64i" 228 | #define SCNoPTR "I64o" 229 | #define SCNxPTR "I64x" 230 | #define SCNuPTR "I64u" 231 | #else 232 | #define PRIdPTR "d" 233 | #define PRIiPTR "i" 234 | #define PRIoPTR "o" 235 | #define PRIuPTR "u" 236 | #define PRIxPTR "x" 237 | #define PRIXPTR "X" 238 | #define SCNdPTR "d" 239 | #define SCNiPTR "i" 240 | #define SCNoPTR "o" 241 | #define SCNxPTR "x" 242 | #define SCNuPTR "u" 243 | #endif 244 | 245 | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 246 | /* 247 | * no length modifier for char types prior to C9x 248 | * MS runtime scanf appears to treat "hh" as "h" 249 | */ 250 | 251 | /* signed char */ 252 | #define SCNd8 "hhd" 253 | #define SCNdLEAST8 "hhd" 254 | #define SCNdFAST8 "hhd" 255 | 256 | #define SCNi8 "hhi" 257 | #define SCNiLEAST8 "hhi" 258 | #define SCNiFAST8 "hhi" 259 | 260 | #define SCNo8 "hho" 261 | #define SCNoLEAST8 "hho" 262 | #define SCNoFAST8 "hho" 263 | 264 | #define SCNx8 "hhx" 265 | #define SCNxLEAST8 "hhx" 266 | #define SCNxFAST8 "hhx" 267 | 268 | /* unsigned char */ 269 | #define SCNu8 "hhu" 270 | #define SCNuLEAST8 "hhu" 271 | #define SCNuFAST8 "hhu" 272 | #endif /* __STDC_VERSION__ >= 199901 */ 273 | 274 | #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ 275 | 276 | intmax_t __cdecl imaxabs (intmax_t j); 277 | __CRT_INLINE intmax_t __cdecl imaxabs (intmax_t j) 278 | {return (j >= 0 ? j : -j);} 279 | imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom); 280 | 281 | /* 7.8.2 Conversion functions for greatest-width integer types */ 282 | 283 | intmax_t __cdecl strtoimax (const char* __restrict__ nptr, 284 | char** __restrict__ endptr, int base); 285 | uintmax_t __cdecl strtoumax (const char* __restrict__ nptr, 286 | char** __restrict__ endptr, int base); 287 | 288 | intmax_t __cdecl wcstoimax (const wchar_t* __restrict__ nptr, 289 | wchar_t** __restrict__ endptr, int base); 290 | uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr, 291 | wchar_t** __restrict__ endptr, int base); 292 | 293 | #ifdef __cplusplus 294 | } 295 | #endif 296 | 297 | #endif /* ndef _INTTYPES_H */ 298 | -------------------------------------------------------------------------------- /include/winapi/rpcasync.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __RPCASYNC_H__ 7 | #define __RPCASYNC_H__ 8 | 9 | #ifdef __RPC_WIN64__ 10 | #include 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #define RPC_ASYNC_VERSION_1_0 sizeof(RPC_ASYNC_STATE) 18 | 19 | typedef enum _RPC_NOTIFICATION_TYPES { 20 | RpcNotificationTypeNone,RpcNotificationTypeEvent,RpcNotificationTypeApc,RpcNotificationTypeIoc,RpcNotificationTypeHwnd, 21 | RpcNotificationTypeCallback 22 | } RPC_NOTIFICATION_TYPES; 23 | 24 | typedef enum _RPC_ASYNC_EVENT { 25 | RpcCallComplete,RpcSendComplete,RpcReceiveComplete 26 | } RPC_ASYNC_EVENT; 27 | 28 | struct _RPC_ASYNC_STATE; 29 | 30 | typedef void RPC_ENTRY RPCNOTIFICATION_ROUTINE(struct _RPC_ASYNC_STATE *pAsync,void *Context,RPC_ASYNC_EVENT Event); 31 | typedef RPCNOTIFICATION_ROUTINE *PFN_RPCNOTIFICATION_ROUTINE; 32 | 33 | typedef struct _RPC_ASYNC_STATE { 34 | unsigned int Size; 35 | unsigned long Signature; 36 | long Lock; 37 | unsigned long Flags; 38 | void *StubInfo; 39 | void *UserInfo; 40 | void *RuntimeInfo; 41 | RPC_ASYNC_EVENT Event; 42 | RPC_NOTIFICATION_TYPES NotificationType; 43 | union { 44 | struct { 45 | PFN_RPCNOTIFICATION_ROUTINE NotificationRoutine; 46 | HANDLE hThread; 47 | } APC; 48 | struct { 49 | HANDLE hIOPort; 50 | DWORD dwNumberOfBytesTransferred; 51 | DWORD_PTR dwCompletionKey; 52 | LPOVERLAPPED lpOverlapped; 53 | } IOC; 54 | struct { 55 | HWND hWnd; 56 | UINT Msg; 57 | } HWND; 58 | HANDLE hEvent; 59 | PFN_RPCNOTIFICATION_ROUTINE NotificationRoutine; 60 | } u; 61 | LONG_PTR Reserved[4]; 62 | } RPC_ASYNC_STATE,*PRPC_ASYNC_STATE; 63 | 64 | #define RPC_C_NOTIFY_ON_SEND_COMPLETE 0x1 65 | #define RPC_C_INFINITE_TIMEOUT INFINITE 66 | 67 | #define RpcAsyncGetCallHandle(pAsync) (((PRPC_ASYNC_STATE) pAsync)->RuntimeInfo) 68 | 69 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncInitializeHandle(PRPC_ASYNC_STATE pAsync,unsigned int Size); 70 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncRegisterInfo(PRPC_ASYNC_STATE pAsync); 71 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncGetCallStatus(PRPC_ASYNC_STATE pAsync); 72 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncCompleteCall(PRPC_ASYNC_STATE pAsync,void *Reply); 73 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncAbortCall(PRPC_ASYNC_STATE pAsync,unsigned long ExceptionCode); 74 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncCancelCall(PRPC_ASYNC_STATE pAsync,WINBOOL fAbort); 75 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncCleanupThread(DWORD dwTimeout); 76 | 77 | typedef enum tagExtendedErrorParamTypes { 78 | eeptAnsiString = 1,eeptUnicodeString,eeptLongVal,eeptShortVal,eeptPointerVal,eeptNone,eeptBinary 79 | } ExtendedErrorParamTypes; 80 | 81 | #define MaxNumberOfEEInfoParams 4 82 | #define RPC_EEINFO_VERSION 1 83 | 84 | typedef struct tagBinaryParam { 85 | void *Buffer; 86 | short Size; 87 | } BinaryParam; 88 | 89 | typedef struct tagRPC_EE_INFO_PARAM { 90 | ExtendedErrorParamTypes ParameterType; 91 | union { 92 | LPSTR AnsiString; 93 | LPWSTR UnicodeString; 94 | long LVal; 95 | short SVal; 96 | ULONGLONG PVal; 97 | BinaryParam BVal; 98 | } u; 99 | } RPC_EE_INFO_PARAM; 100 | 101 | #define EEInfoPreviousRecordsMissing 1 102 | #define EEInfoNextRecordsMissing 2 103 | #define EEInfoUseFileTime 4 104 | 105 | #define EEInfoGCCOM 11 106 | #define EEInfoGCFRS 12 107 | 108 | typedef struct tagRPC_EXTENDED_ERROR_INFO { 109 | ULONG Version; 110 | LPWSTR ComputerName; 111 | ULONG ProcessID; 112 | union { 113 | SYSTEMTIME SystemTime; 114 | FILETIME FileTime; 115 | } u; 116 | ULONG GeneratingComponent; 117 | ULONG Status; 118 | USHORT DetectionLocation; 119 | USHORT Flags; 120 | int NumberOfParameters; 121 | RPC_EE_INFO_PARAM Parameters[MaxNumberOfEEInfoParams]; 122 | } RPC_EXTENDED_ERROR_INFO; 123 | 124 | typedef struct tagRPC_ERROR_ENUM_HANDLE { 125 | ULONG Signature; 126 | void *CurrentPos; 127 | void *Head; 128 | } RPC_ERROR_ENUM_HANDLE; 129 | 130 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorStartEnumeration(RPC_ERROR_ENUM_HANDLE *EnumHandle); 131 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorGetNextRecord(RPC_ERROR_ENUM_HANDLE *EnumHandle,WINBOOL CopyStrings,RPC_EXTENDED_ERROR_INFO *ErrorInfo); 132 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorEndEnumeration(RPC_ERROR_ENUM_HANDLE *EnumHandle); 133 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorResetEnumeration(RPC_ERROR_ENUM_HANDLE *EnumHandle); 134 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorGetNumberOfRecords(RPC_ERROR_ENUM_HANDLE *EnumHandle,int *Records); 135 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorSaveErrorInfo(RPC_ERROR_ENUM_HANDLE *EnumHandle,PVOID *ErrorBlob,size_t *BlobSize); 136 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorLoadErrorInfo(PVOID ErrorBlob,size_t BlobSize,RPC_ERROR_ENUM_HANDLE *EnumHandle); 137 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorAddRecord(RPC_EXTENDED_ERROR_INFO *ErrorInfo); 138 | RPCRTAPI void RPC_ENTRY RpcErrorClearInformation(void); 139 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcGetAuthorizationContextForClient(RPC_BINDING_HANDLE ClientBinding,WINBOOL ImpersonateOnReturn,PVOID Reserved1,PLARGE_INTEGER pExpirationTime,LUID Reserved2,DWORD Reserved3,PVOID Reserved4,PVOID *pAuthzClientContext); 140 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcFreeAuthorizationContext(PVOID *pAuthzClientContext); 141 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcSsContextLockExclusive(RPC_BINDING_HANDLE ServerBindingHandle,PVOID UserContext); 142 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcSsContextLockShared(RPC_BINDING_HANDLE ServerBindingHandle,PVOID UserContext); 143 | 144 | #define RPC_CALL_ATTRIBUTES_VERSION (1) 145 | #define RPC_QUERY_SERVER_PRINCIPAL_NAME (2) 146 | #define RPC_QUERY_CLIENT_PRINCIPAL_NAME (4) 147 | 148 | typedef struct tagRPC_CALL_ATTRIBUTES_V1_W { 149 | unsigned int Version; 150 | unsigned long Flags; 151 | unsigned long ServerPrincipalNameBufferLength; 152 | unsigned short *ServerPrincipalName; 153 | unsigned long ClientPrincipalNameBufferLength; 154 | unsigned short *ClientPrincipalName; 155 | unsigned long AuthenticationLevel; 156 | unsigned long AuthenticationService; 157 | WINBOOL NullSession; 158 | } RPC_CALL_ATTRIBUTES_V1_W; 159 | 160 | typedef struct tagRPC_CALL_ATTRIBUTES_V1_A { 161 | unsigned int Version; 162 | unsigned long Flags; 163 | unsigned long ServerPrincipalNameBufferLength; 164 | unsigned char *ServerPrincipalName; 165 | unsigned long ClientPrincipalNameBufferLength; 166 | unsigned char *ClientPrincipalName; 167 | unsigned long AuthenticationLevel; 168 | unsigned long AuthenticationService; 169 | WINBOOL NullSession; 170 | } RPC_CALL_ATTRIBUTES_V1_A; 171 | 172 | #ifdef UNICODE 173 | #define RPC_CALL_ATTRIBUTES_V1 RPC_CALL_ATTRIBUTES_V1_W 174 | #define RpcServerInqCallAttributes RpcServerInqCallAttributesW 175 | #else 176 | #define RPC_CALL_ATTRIBUTES_V1 RPC_CALL_ATTRIBUTES_V1_A 177 | #define RpcServerInqCallAttributes RpcServerInqCallAttributesA 178 | #endif 179 | 180 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcServerInqCallAttributesW(RPC_BINDING_HANDLE ClientBinding,void *RpcCallAttributes); 181 | RPCRTAPI RPC_STATUS RPC_ENTRY RpcServerInqCallAttributesA(RPC_BINDING_HANDLE ClientBinding,void *RpcCallAttributes); 182 | 183 | typedef RPC_CALL_ATTRIBUTES_V1 RPC_CALL_ATTRIBUTES; 184 | 185 | RPC_STATUS RPC_ENTRY I_RpcAsyncSetHandle(PRPC_MESSAGE Message,PRPC_ASYNC_STATE pAsync); 186 | RPC_STATUS RPC_ENTRY I_RpcAsyncAbortCall(PRPC_ASYNC_STATE pAsync,unsigned long ExceptionCode); 187 | int RPC_ENTRY I_RpcExceptionFilter(unsigned long ExceptionCode); 188 | 189 | #ifdef __cplusplus 190 | } 191 | #endif 192 | 193 | #ifdef __RPC_WIN64__ 194 | #include 195 | #endif 196 | #endif 197 | -------------------------------------------------------------------------------- /include/sec_api/wchar_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_WCHAR_S 7 | #define _INC_WCHAR_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifndef _WIO_S_DEFINED 18 | #define _WIO_S_DEFINED 19 | _CRTIMP errno_t __cdecl _waccess_s(const wchar_t *_Filename,int _AccessMode); 20 | _CRTIMP errno_t __cdecl _wmktemp_s(wchar_t *_TemplateName,size_t _SizeInWords); 21 | #endif 22 | 23 | #ifndef _WCONIO_S_DEFINED 24 | #define _WCONIO_S_DEFINED 25 | _CRTIMP errno_t __cdecl _cgetws_s(wchar_t *_Buffer,size_t _SizeInWords,size_t *_SizeRead); 26 | _CRTIMP int __cdecl _cwprintf_s(const wchar_t *_Format,...); 27 | _CRTIMP int __cdecl _cwscanf_s(const wchar_t *_Format,...); 28 | _CRTIMP int __cdecl _cwscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 29 | _CRTIMP int __cdecl _vcwprintf_s(const wchar_t *_Format,va_list _ArgList); 30 | _CRTIMP int __cdecl _cwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 31 | _CRTIMP int __cdecl _vcwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); 32 | #endif 33 | 34 | #ifndef _WSTDIO_S_DEFINED 35 | #define _WSTDIO_S_DEFINED 36 | _CRTIMP wchar_t *__cdecl _getws_s(wchar_t *_Str,size_t _SizeInWords); 37 | int __cdecl fwprintf_s(FILE *_File,const wchar_t *_Format,...); 38 | int __cdecl wprintf_s(const wchar_t *_Format,...); 39 | int __cdecl vfwprintf_s(FILE *_File,const wchar_t *_Format,va_list _ArgList); 40 | int __cdecl vwprintf_s(const wchar_t *_Format,va_list _ArgList); 41 | int __cdecl swprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,...); 42 | int __cdecl vswprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList); 43 | _CRTIMP int __cdecl _snwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,...); 44 | _CRTIMP int __cdecl _vsnwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList); 45 | _CRTIMP int __cdecl _wprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 46 | _CRTIMP int __cdecl _vwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); 47 | _CRTIMP int __cdecl _fwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); 48 | _CRTIMP int __cdecl _vfwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); 49 | _CRTIMP int __cdecl _swprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,...); 50 | _CRTIMP int __cdecl _vswprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); 51 | _CRTIMP int __cdecl _snwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); 52 | _CRTIMP int __cdecl _vsnwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); 53 | _CRTIMP int __cdecl _fwscanf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); 54 | _CRTIMP int __cdecl _swscanf_s_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...); 55 | _CRTIMP int __cdecl _snwscanf_s(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...); 56 | _CRTIMP int __cdecl _snwscanf_s_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); 57 | _CRTIMP int __cdecl _wscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 58 | _CRTIMP errno_t __cdecl _wfopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode); 59 | _CRTIMP errno_t __cdecl _wfreopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile); 60 | _CRTIMP errno_t __cdecl _wtmpnam_s(wchar_t *_DstBuf,size_t _SizeInWords); 61 | #endif 62 | 63 | #ifndef _WSTDLIB_S_DEFINED 64 | #define _WSTDLIB_S_DEFINED 65 | _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 66 | _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 67 | _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 68 | _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); 69 | _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName); 70 | #if _INTEGRAL_MAX_BITS >= 64 71 | _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 72 | _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 73 | #endif 74 | #endif 75 | 76 | #ifndef _POSIX_ 77 | #ifndef _WSTDLIBP_S_DEFINED 78 | #define _WSTDLIBP_S_DEFINED 79 | _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); 80 | _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value); 81 | _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); 82 | _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); 83 | #endif 84 | #endif 85 | 86 | #ifndef _WSTRING_S_DEFINED 87 | #define _WSTRING_S_DEFINED 88 | _CRTIMP wchar_t *__cdecl wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context); 89 | _CRTIMP errno_t __cdecl _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum); 90 | _CRTIMP errno_t __cdecl __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg); 91 | _CRTIMP errno_t __cdecl _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount); 92 | _CRTIMP errno_t __cdecl _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val); 93 | _CRTIMP errno_t __cdecl _wcslwr_s(wchar_t *_Str,size_t _SizeInWords); 94 | _CRTIMP errno_t __cdecl _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale); 95 | _CRTIMP errno_t __cdecl _wcsupr_s(wchar_t *_Str,size_t _Size); 96 | _CRTIMP errno_t __cdecl _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale); 97 | #endif 98 | 99 | #ifndef _WTIME_S_DEFINED 100 | #define _WTIME_S_DEFINED 101 | _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm); 102 | _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time); 103 | _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords); 104 | _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords); 105 | #if _INTEGRAL_MAX_BITS >= 64 106 | _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time); 107 | #endif 108 | 109 | #if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) 110 | #define _INC_WTIME_S_INL 111 | #ifdef _USE_32BIT_TIME_T 112 | __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s(_Buffer,_SizeInWords,_Time); } 113 | #else 114 | __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer,_SizeInWords,_Time); } 115 | #endif 116 | #endif 117 | #endif 118 | 119 | _CRTIMP errno_t __cdecl mbsrtowcs_s(size_t *_Retval,wchar_t *_Dst,size_t _SizeInWords,const char **_PSrc,size_t _N,mbstate_t *_State); 120 | _CRTIMP errno_t __cdecl wcrtomb_s(size_t *_Retval,char *_Dst,size_t _SizeInBytes,wchar_t _Ch,mbstate_t *_State); 121 | _CRTIMP errno_t __cdecl wcsrtombs_s(size_t *_Retval,char *_Dst,size_t _SizeInBytes,const wchar_t **_Src,size_t _Size,mbstate_t *_State); 122 | 123 | #ifdef __cplusplus 124 | } 125 | #endif 126 | 127 | #endif 128 | #endif 129 | --------------------------------------------------------------------------------