├── Logo.png ├── Debug.png ├── NikmaASM.exe ├── Test ├── prog.exe └── prog.nikasm ├── tcc ├── tcc.exe ├── libtcc.dll ├── lib │ ├── libtcc1-32.a │ ├── libtcc1-64.a │ └── gdi32.def ├── i386-win32-tcc.exe ├── include │ ├── values.h │ ├── stdbool.h │ ├── winapi │ │ ├── poppack.h │ │ ├── pshpack1.h │ │ ├── pshpack2.h │ │ ├── pshpack4.h │ │ ├── pshpack8.h │ │ ├── basetyps.h │ │ ├── windows.h │ │ ├── guiddef.h │ │ ├── winver.h │ │ ├── basetsd.h │ │ └── windef.h │ ├── vadefs.h │ ├── mem.h │ ├── varargs.h │ ├── sys │ │ ├── fcntl.h │ │ ├── unistd.h │ │ ├── file.h │ │ ├── locking.h │ │ ├── time.h │ │ ├── types.h │ │ ├── timeb.h │ │ ├── utime.h │ │ └── stat.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 │ ├── share.h │ ├── dir.h │ ├── dos.h │ ├── memory.h │ ├── fcntl.h │ ├── float.h │ ├── stddef.h │ ├── assert.h │ ├── errno.h │ ├── signal.h │ ├── direct.h │ ├── locale.h │ ├── stdarg.h │ ├── tcclib.h │ ├── limits.h │ ├── fenv.h │ ├── dirent.h │ ├── excpt.h │ ├── setjmp.h │ ├── _mingw.h │ ├── wctype.h │ ├── malloc.h │ ├── tcc │ │ └── tcc_libm.h │ ├── stdint.h │ ├── inttypes.h │ └── string.h ├── examples │ ├── dll.c │ ├── fib.c │ ├── hello_dll.c │ ├── libtcc_test.c │ └── hello_win.c ├── libtcc │ ├── libtcc.def │ └── libtcc.h └── doc │ └── tcc-win32.txt ├── Source ├── NikmaCompiler │ ├── obj │ │ ├── Debug │ │ │ ├── NikmaASM.exe │ │ │ ├── NikmaASM.pdb │ │ │ ├── NikmaCompiler.csproj.CoreCompileInputs.cache │ │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ │ ├── NikmaCompiler.csproj.AssemblyReference.cache │ │ │ ├── NikmaCompiler.csproj.FileListAbsolute.txt │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Release │ │ │ ├── NikmaASM.exe │ │ │ ├── NikmaASM.pdb │ │ │ ├── NikmaCompiler.csproj.CoreCompileInputs.cache │ │ │ ├── NikmaCompiler.csproj.AssemblyReference.cache │ │ │ ├── NikmaCompiler.csproj.FileListAbsolute.txt │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── App.config │ ├── NikmaCompiler.csproj.user │ ├── Properties │ │ └── AssemblyInfo.cs │ └── NikmaCompiler.csproj └── NikmaCompiler.sln ├── NikmaVM ├── Structures.h ├── Enums.h └── OpcodeFunctions.h └── LICENSE /Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Logo.png -------------------------------------------------------------------------------- /Debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Debug.png -------------------------------------------------------------------------------- /NikmaASM.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/NikmaASM.exe -------------------------------------------------------------------------------- /Test/prog.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Test/prog.exe -------------------------------------------------------------------------------- /tcc/tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/tcc/tcc.exe -------------------------------------------------------------------------------- /tcc/libtcc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/tcc/libtcc.dll -------------------------------------------------------------------------------- /tcc/lib/libtcc1-32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/tcc/lib/libtcc1-32.a -------------------------------------------------------------------------------- /tcc/lib/libtcc1-64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/tcc/lib/libtcc1-64.a -------------------------------------------------------------------------------- /tcc/i386-win32-tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/tcc/i386-win32-tcc.exe -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Debug/NikmaASM.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Source/NikmaCompiler/obj/Debug/NikmaASM.exe -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Debug/NikmaASM.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Source/NikmaCompiler/obj/Debug/NikmaASM.pdb -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Release/NikmaASM.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Source/NikmaCompiler/obj/Release/NikmaASM.exe -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Release/NikmaASM.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Source/NikmaCompiler/obj/Release/NikmaASM.pdb -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Debug/NikmaCompiler.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 137ddb1975586287657f37337b64d051167bb6a147915d9fb5b8eb94b1093509 2 | -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Release/NikmaCompiler.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 979fc59c1f2afcc3443738cd70ff09bf60f7ecb8fbff0eec3eb8b752a83b3e04 2 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Source/NikmaCompiler/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Debug/NikmaCompiler.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Source/NikmaCompiler/obj/Debug/NikmaCompiler.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Release/NikmaCompiler.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexorus/NikmaASM/HEAD/Source/NikmaCompiler/obj/Release/NikmaCompiler.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /Source/NikmaCompiler/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/examples/dll.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // dll.c - Windows DLL example - dynamically linked part 4 | // 5 | 6 | #include 7 | 8 | __declspec(dllexport) const char *hello_data = "(not set)"; 9 | 10 | __declspec(dllexport) void hello_func (void) 11 | { 12 | MessageBox (0, hello_data, "From DLL", MB_ICONINFORMATION); 13 | } 14 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /Test/prog.nikasm: -------------------------------------------------------------------------------- 1 | push "Advapi32.dll" 2 | import [sp] 3 | push "aaaaaaaaaaaa" 4 | mov r1, sp 5 | mov rb, sp 6 | push 256 7 | mov r2, sp 8 | call GetUserNameA 9 | import kernel32.dll 10 | push "bbbbbbbbbbbb" 11 | mov r1, sp 12 | mov rc, sp 13 | push 256 14 | mov r2, sp 15 | call GetComputerNameA 16 | import user32.dll 17 | xor r1, r1 18 | mov r2, rc 19 | mov r3, rb 20 | mov r4, 1 21 | call MessageBoxA -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/examples/fib.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include // atoi() 3 | 4 | int fib(n) 5 | { 6 | if (n <= 2) 7 | return 1; 8 | else 9 | return fib(n-1) + fib(n-2); 10 | } 11 | 12 | int main(int argc, char **argv) 13 | { 14 | int n; 15 | if (argc < 2) { 16 | printf("usage: fib n\n" 17 | "Compute nth Fibonacci number\n"); 18 | return 1; 19 | } 20 | 21 | n = atoi(argv[1]); 22 | printf("fib(%d) = %d\n", n, fib(n)); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /Source/NikmaCompiler/NikmaCompiler.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | prog.nikasm 5 | Project 6 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\bin\Release\ 7 | 8 | -------------------------------------------------------------------------------- /tcc/examples/hello_dll.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // HELLO_DLL.C - Windows DLL example - main application part 4 | // 5 | 6 | #include 7 | 8 | void hello_func (void); 9 | __declspec(dllimport) extern const char *hello_data; 10 | 11 | int WINAPI WinMain( 12 | HINSTANCE hInstance, 13 | HINSTANCE hPrevInstance, 14 | LPSTR lpCmdLine, 15 | int nCmdShow) 16 | { 17 | hello_data = "Hello World!"; 18 | hello_func(); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /NikmaVM/Structures.h: -------------------------------------------------------------------------------- 1 | #ifndef STRUCTURES_H 2 | #define STRUCTURES_H 3 | 4 | #define MAX_REGISTERS 14 5 | 6 | 7 | typedef struct { 8 | uint8_t opcode; 9 | union { 10 | int32_t num; 11 | char *str; 12 | int8_t reg; 13 | } first_operand; 14 | union { 15 | int32_t num; 16 | char *str; 17 | int8_t reg; 18 | } second_operand; 19 | } Instruction; 20 | 21 | typedef struct 22 | { 23 | int32_t registers[MAX_REGISTERS]; 24 | int8_t flag; 25 | int32_t *stack; 26 | size_t stack_max; 27 | Instruction *instructions; 28 | size_t instructions_count; 29 | } VM; 30 | 31 | #endif -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Debug/NikmaCompiler.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Debug\NikmaCompiler.csproj.AssemblyReference.cache 2 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Debug\NikmaCompiler.csproj.CoreCompileInputs.cache 3 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\bin\Debug\NikmaASM.exe.config 4 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\bin\Debug\NikmaASM.exe 5 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\bin\Debug\NikmaASM.pdb 6 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Debug\NikmaASM.exe 7 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Debug\NikmaASM.pdb 8 | -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Release/NikmaCompiler.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\bin\Release\NikmaASM.exe.config 2 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\bin\Release\NikmaASM.exe 3 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\bin\Release\NikmaASM.pdb 4 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Release\NikmaCompiler.csproj.AssemblyReference.cache 5 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Release\NikmaCompiler.csproj.CoreCompileInputs.cache 6 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Release\NikmaASM.exe 7 | C:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Release\NikmaASM.pdb 8 | -------------------------------------------------------------------------------- /tcc/libtcc/libtcc.def: -------------------------------------------------------------------------------- 1 | LIBRARY libtcc.dll 2 | 3 | EXPORTS 4 | tcc_add_file 5 | tcc_add_include_path 6 | tcc_add_library 7 | tcc_add_library_err 8 | tcc_add_library_path 9 | tcc_add_symbol 10 | tcc_add_sysinclude_path 11 | tcc_basename 12 | tcc_compile_string 13 | tcc_define_symbol 14 | tcc_delete 15 | tcc_error 16 | tcc_error_noabort 17 | tcc_fileextension 18 | tcc_free 19 | tcc_get_dllexports 20 | tcc_get_symbol 21 | tcc_malloc 22 | tcc_mallocz 23 | tcc_memcheck 24 | tcc_new 25 | tcc_output_file 26 | tcc_parse_args 27 | tcc_print_stats 28 | tcc_realloc 29 | tcc_relocate 30 | tcc_run 31 | tcc_set_error_func 32 | tcc_set_lib_path 33 | tcc_set_options 34 | tcc_set_output_type 35 | tcc_strdup 36 | tcc_undefine_symbol 37 | tcc_warning 38 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /NikmaVM/Enums.h: -------------------------------------------------------------------------------- 1 | // n - num 2 | // r - register 3 | // p - pointer 4 | // s - string 5 | 6 | 7 | enum { 8 | OP_MOV_n = 14, OP_MOV_r, 9 | OP_ADD_n, OP_ADD_r, 10 | OP_SUB_n, OP_SUB_r, 11 | OP_DIV_n, OP_DIV_r, 12 | OP_MUL_n, OP_MUL_r, 13 | OP_MOD_n, OP_MOD_r, 14 | OP_AND_n, OP_AND_r, 15 | OP_XOR_n, OP_XOR_r, 16 | OP_OR_n, OP_OR_r, 17 | OP_POP_r, 18 | OP_PUSH_n, OP_PUSH_r, OP_PUSH_s, 19 | OP_CMP_n, OP_CMP_r, OP_CMP_p, 20 | OP_JZ_n, OP_JZ_r, 21 | OP_JNZ_n, OP_JNZ_r, 22 | OP_JMP_n, OP_JMP_r, 23 | OP_STDOUT_r, OP_STDOUT_p, 24 | OP_STDIN, 25 | OP_EXIT_n, OP_EXIT_r, 26 | OP_IMPORT_p, OP_IMPORT_s, 27 | OP_CALL_p, OP_CALL_s, 28 | OP_CLR 29 | }; 30 | 31 | enum { 32 | ra, rb, rc, rd, 33 | r1, r2, r3, r4, r5, r6, r7, r8, 34 | sp, ip 35 | }; 36 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /NikmaVM/OpcodeFunctions.h: -------------------------------------------------------------------------------- 1 | #ifndef OPCODE_FUNCTIONS_H 2 | #define OPCODE_FUNCTIONS_H 3 | 4 | #include "Structures.h" 5 | 6 | void Error(char *text); 7 | 8 | void mov(VM *vm, int8_t mode, int i); 9 | void add(VM *vm, int8_t mode, int i); 10 | void sub(VM *vm, int8_t mode, int i); 11 | void Div(VM *vm, int8_t mode, int i); 12 | void mul(VM *vm, int8_t mode, int i); 13 | void mod(VM *vm, int8_t mode, int i); 14 | void and(VM *vm, int8_t mode, int i); 15 | void xor(VM *vm, int8_t mode, int i); 16 | void or(VM *vm, int8_t mode, int i); 17 | void push(VM *vm, int8_t mode, int i); 18 | void pop(VM *vm, int i); 19 | void cmp(VM *vm, int8_t mode, int i); 20 | void jz(VM *vm, int8_t mode, int i); 21 | void jnz(VM *vm, int8_t mode, int i); 22 | void jmp(VM *vm, int8_t mode, int i); 23 | void standartOutput(VM *vm, int8_t mode, int i); 24 | void standartInput(VM *vm, int i); 25 | void import(VM *vm, int8_t mode, int i); 26 | void exitProc(VM *vm, int8_t mode, int i); 27 | void call(VM *vm, int8_t mode, int i); 28 | void clr(VM *vm); 29 | 30 | #endif -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 vexor 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Source/NikmaCompiler.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.8.34511.84 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NikmaCompiler", "NikmaCompiler\NikmaCompiler.csproj", "{70B1BFCE-C9F7-4D27-80B8-6E5A3319EB45}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {70B1BFCE-C9F7-4D27-80B8-6E5A3319EB45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {70B1BFCE-C9F7-4D27-80B8-6E5A3319EB45}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {70B1BFCE-C9F7-4D27-80B8-6E5A3319EB45}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {70B1BFCE-C9F7-4D27-80B8-6E5A3319EB45}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {1B2B9D92-D0F1-41A0-941E-DC7E2E1BA1AD} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | #ifndef __int8_t_defined 12 | #define __int8_t_defined 13 | typedef signed char int8_t; 14 | typedef signed short int int16_t; 15 | typedef signed int int32_t; 16 | #ifdef __LP64__ 17 | typedef signed long int int64_t; 18 | #else 19 | typedef signed long long int int64_t; 20 | #endif 21 | typedef unsigned char uint8_t; 22 | typedef unsigned short int uint16_t; 23 | typedef unsigned int uint32_t; 24 | #ifdef __LP64__ 25 | typedef unsigned long int uint64_t; 26 | #else 27 | typedef unsigned long long int uint64_t; 28 | #endif 29 | #endif 30 | 31 | #ifndef NULL 32 | #define NULL ((void*)0) 33 | #endif 34 | 35 | #define offsetof(type, field) ((size_t)&((type *)0)->field) 36 | 37 | void *alloca(size_t size); 38 | 39 | #endif 40 | 41 | /* Older glibc require a wint_t from (when requested 42 | by __need_wint_t, as otherwise stddef.h isn't allowed to 43 | define this type). Note that this must be outside the normal 44 | _STDDEF_H guard, so that it works even when we've included the file 45 | already (without requiring wint_t). Some other libs define _WINT_T 46 | if they've already provided that type, so we can use that as guard. 47 | TCC defines __WINT_TYPE__ for us. */ 48 | #if defined (__need_wint_t) 49 | #ifndef _WINT_T 50 | #define _WINT_T 51 | typedef __WINT_TYPE__ wint_t; 52 | #endif 53 | #undef __need_wint_t 54 | #endif 55 | -------------------------------------------------------------------------------- /Source/NikmaCompiler/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Общие сведения об этой сборке предоставляются следующим набором 6 | // набора атрибутов. Измените значения этих атрибутов для изменения сведений, 7 | // связанные с этой сборкой. 8 | [assembly: AssemblyTitle("NikmaCompiler")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NikmaCompiler")] 13 | [assembly: AssemblyCopyright("Copyright © 2024")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми 18 | // для компонентов COM. Если необходимо обратиться к типу в этой сборке через 19 | // из модели COM задайте для атрибута ComVisible этого типа значение true. 20 | [assembly: ComVisible(false)] 21 | 22 | // Следующий GUID представляет идентификатор typelib, если этот проект доступен из модели COM 23 | [assembly: Guid("70b1bfce-c9f7-4d27-80b8-6e5a3319eb45")] 24 | 25 | // Сведения о версии сборки состоят из указанных ниже четырех значений: 26 | // 27 | // Основной номер версии 28 | // Дополнительный номер версии 29 | // Номер сборки 30 | // Номер редакции 31 | // 32 | // Можно задать все значения или принять номера сборки и редакции по умолчанию 33 | // используя "*", как показано ниже: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /tcc/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 | #endif 58 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- 1 | .winmd.dll.exe 2 | 3C:\Users\user\source\repos\NikmaCompiler\App.configiC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Microsoft.CSharp.dllaC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\mscorlib.dlldC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Core.dllvC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Data.DataSetExtensions.dlldC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Data.dll_C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.dllhC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Net.Http.dllcC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xml.dllhC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xml.Linq.dllUC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Full{CandidateAssemblyFiles}{HintPathFromItem}{TargetFrameworkDirectory}D{Registry:Software\Microsoft\.NETFramework,v4.7.2,AssemblyFoldersEx} {RawFileName}CC:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\bin\Release\D{Registry:Software\Microsoft\.NETFramework,v4.7.2,AssemblyFoldersEx}lC:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Release\DesignTimeResolveAssemblyReferences.cacheUC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\]C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\.NETFramework,Version=v4.7.2.NET Framework 4.7.2v4.7.2msil 3 | v4.0.30319 -------------------------------------------------------------------------------- /Source/NikmaCompiler/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- 1 | .winmd.dll.exe 2 | AC:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\App.configiC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Microsoft.CSharp.dllaC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\mscorlib.dlldC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Core.dllvC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Data.DataSetExtensions.dlldC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Data.dll_C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.dllhC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Net.Http.dllcC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xml.dllhC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Xml.Linq.dllUC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Full{CandidateAssemblyFiles}{HintPathFromItem}{TargetFrameworkDirectory}D{Registry:Software\Microsoft\.NETFramework,v4.7.2,AssemblyFoldersEx} {RawFileName}AC:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\bin\Debug\D{Registry:Software\Microsoft\.NETFramework,v4.7.2,AssemblyFoldersEx}jC:\Users\user\source\repos\NikmaCompiler\NikmaCompiler\obj\Debug\DesignTimeResolveAssemblyReferences.cacheUC:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\]C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\Facades\.NETFramework,Version=v4.7.2.NET Framework 4.7.2v4.7.2amd64 3 | v4.0.30319 -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /Source/NikmaCompiler/NikmaCompiler.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {70B1BFCE-C9F7-4D27-80B8-6E5A3319EB45} 8 | Exe 9 | NikmaASM 10 | NikmaASM 11 | v4.7.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | x64 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | false 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /tcc/examples/libtcc_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple Test program for libtcc 3 | * 4 | * libtcc can be useful to use tcc as a "backend" for a code generator. 5 | */ 6 | #include 7 | #include 8 | #include 9 | 10 | #include "libtcc.h" 11 | 12 | /* this function is called by the generated code */ 13 | int add(int a, int b) 14 | { 15 | return a + b; 16 | } 17 | 18 | /* this strinc is referenced by the generated code */ 19 | const char hello[] = "Hello World!"; 20 | 21 | char my_program[] = 22 | "#include \n" /* include the "Simple libc header for TCC" */ 23 | "extern int add(int a, int b);\n" 24 | "#ifdef _WIN32\n" /* dynamically linked data needs 'dllimport' */ 25 | " __attribute__((dllimport))\n" 26 | "#endif\n" 27 | "extern const char hello[];\n" 28 | "int fib(int n)\n" 29 | "{\n" 30 | " if (n <= 2)\n" 31 | " return 1;\n" 32 | " else\n" 33 | " return fib(n-1) + fib(n-2);\n" 34 | "}\n" 35 | "\n" 36 | "int foo(int n)\n" 37 | "{\n" 38 | " printf(\"%s\\n\", hello);\n" 39 | " printf(\"fib(%d) = %d\\n\", n, fib(n));\n" 40 | " printf(\"add(%d, %d) = %d\\n\", n, 2 * n, add(n, 2 * n));\n" 41 | " return 0;\n" 42 | "}\n"; 43 | 44 | int main(int argc, char **argv) 45 | { 46 | TCCState *s; 47 | int i; 48 | int (*func)(int); 49 | 50 | s = tcc_new(); 51 | if (!s) { 52 | fprintf(stderr, "Could not create tcc state\n"); 53 | exit(1); 54 | } 55 | 56 | /* if tcclib.h and libtcc1.a are not installed, where can we find them */ 57 | for (i = 1; i < argc; ++i) { 58 | char *a = argv[i]; 59 | if (a[0] == '-') { 60 | if (a[1] == 'B') 61 | tcc_set_lib_path(s, a+2); 62 | else if (a[1] == 'I') 63 | tcc_add_include_path(s, a+2); 64 | else if (a[1] == 'L') 65 | tcc_add_library_path(s, a+2); 66 | } 67 | } 68 | 69 | /* MUST BE CALLED before any compilation */ 70 | tcc_set_output_type(s, TCC_OUTPUT_MEMORY); 71 | 72 | if (tcc_compile_string(s, my_program) == -1) 73 | return 1; 74 | 75 | /* as a test, we add symbols that the compiled program can use. 76 | You may also open a dll with tcc_add_dll() and use symbols from that */ 77 | tcc_add_symbol(s, "add", add); 78 | tcc_add_symbol(s, "hello", hello); 79 | 80 | /* relocate the code */ 81 | if (tcc_relocate(s, TCC_RELOCATE_AUTO) < 0) 82 | return 1; 83 | 84 | /* get entry symbol */ 85 | func = tcc_get_symbol(s, "foo"); 86 | if (!func) 87 | return 1; 88 | 89 | /* run the code */ 90 | func(32); 91 | 92 | /* delete the state */ 93 | tcc_delete(s); 94 | 95 | return 0; 96 | } 97 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/include/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | #ifdef __x86_64__ 5 | #ifndef _WIN64 6 | 7 | //This should be in sync with the declaration on our lib/libtcc1.c 8 | /* GCC compatible definition of va_list. */ 9 | typedef struct { 10 | unsigned int gp_offset; 11 | unsigned int fp_offset; 12 | union { 13 | unsigned int overflow_offset; 14 | char *overflow_arg_area; 15 | }; 16 | char *reg_save_area; 17 | } __va_list_struct; 18 | 19 | typedef __va_list_struct va_list[1]; 20 | 21 | void __va_start(__va_list_struct *ap, void *fp); 22 | void *__va_arg(__va_list_struct *ap, int arg_type, int size, int align); 23 | 24 | #define va_start(ap, last) __va_start(ap, __builtin_frame_address(0)) 25 | #define va_arg(ap, type) \ 26 | (*(type *)(__va_arg(ap, __builtin_va_arg_types(type), sizeof(type), __alignof__(type)))) 27 | #define va_copy(dest, src) (*(dest) = *(src)) 28 | #define va_end(ap) 29 | 30 | /* avoid conflicting definition for va_list on Macs. */ 31 | #define _VA_LIST_T 32 | 33 | #else /* _WIN64 */ 34 | typedef char *va_list; 35 | #define va_start(ap,last) __builtin_va_start(ap,last) 36 | #define va_arg(ap, t) ((sizeof(t) > 8 || (sizeof(t) & (sizeof(t) - 1))) \ 37 | ? **(t **)((ap += 8) - 8) : *(t *)((ap += 8) - 8)) 38 | #define va_copy(dest, src) ((dest) = (src)) 39 | #define va_end(ap) 40 | #endif 41 | 42 | #elif __arm__ 43 | typedef char *va_list; 44 | #define _tcc_alignof(type) ((int)&((struct {char c;type x;} *)0)->x) 45 | #define _tcc_align(addr,type) (((unsigned)addr + _tcc_alignof(type) - 1) \ 46 | & ~(_tcc_alignof(type) - 1)) 47 | #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) 48 | #define va_arg(ap,type) (ap = (void *) ((_tcc_align(ap,type)+sizeof(type)+3) \ 49 | &~3), *(type *)(ap - ((sizeof(type)+3)&~3))) 50 | #define va_copy(dest, src) (dest) = (src) 51 | #define va_end(ap) 52 | 53 | #elif defined(__aarch64__) 54 | typedef struct { 55 | void *__stack; 56 | void *__gr_top; 57 | void *__vr_top; 58 | int __gr_offs; 59 | int __vr_offs; 60 | } va_list; 61 | #define va_start(ap, last) __va_start(ap, last) 62 | #define va_arg(ap, type) __va_arg(ap, type) 63 | #define va_end(ap) 64 | #define va_copy(dest, src) ((dest) = (src)) 65 | 66 | #else /* __i386__ */ 67 | typedef char *va_list; 68 | /* only correct for i386 */ 69 | #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) 70 | #define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3))) 71 | #define va_copy(dest, src) (dest) = (src) 72 | #define va_end(ap) 73 | #endif 74 | 75 | /* fix a buggy dependency on GCC in libio.h */ 76 | typedef va_list __gnuc_va_list; 77 | #define _VA_LIST_DEFINED 78 | 79 | #endif /* _STDARG_H */ 80 | -------------------------------------------------------------------------------- /tcc/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 | //gr #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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | /* create a new TCC compilation context */ 17 | LIBTCCAPI TCCState *tcc_new(void); 18 | 19 | /* free a TCC compilation context */ 20 | LIBTCCAPI void tcc_delete(TCCState *s); 21 | 22 | /* set CONFIG_TCCDIR at runtime */ 23 | LIBTCCAPI void tcc_set_lib_path(TCCState *s, const char *path); 24 | 25 | /* set error/warning display callback */ 26 | LIBTCCAPI void tcc_set_error_func(TCCState *s, void *error_opaque, 27 | void (*error_func)(void *opaque, const char *msg)); 28 | 29 | /* set options as from command line (multiple supported) */ 30 | LIBTCCAPI void tcc_set_options(TCCState *s, const char *str); 31 | 32 | /*****************************/ 33 | /* preprocessor */ 34 | 35 | /* add include path */ 36 | LIBTCCAPI int tcc_add_include_path(TCCState *s, const char *pathname); 37 | 38 | /* add in system include path */ 39 | LIBTCCAPI int tcc_add_sysinclude_path(TCCState *s, const char *pathname); 40 | 41 | /* define preprocessor symbol 'sym'. Can put optional value */ 42 | LIBTCCAPI void tcc_define_symbol(TCCState *s, const char *sym, const char *value); 43 | 44 | /* undefine preprocess symbol 'sym' */ 45 | LIBTCCAPI void tcc_undefine_symbol(TCCState *s, const char *sym); 46 | 47 | /*****************************/ 48 | /* compiling */ 49 | 50 | /* add a file (C file, dll, object, library, ld script). Return -1 if error. */ 51 | LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename); 52 | 53 | /* compile a string containing a C source. Return -1 if error. */ 54 | LIBTCCAPI int tcc_compile_string(TCCState *s, const char *buf); 55 | 56 | /*****************************/ 57 | /* linking commands */ 58 | 59 | /* set output type. MUST BE CALLED before any compilation */ 60 | LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type); 61 | #define TCC_OUTPUT_MEMORY 1 /* output will be run in memory (default) */ 62 | #define TCC_OUTPUT_EXE 2 /* executable file */ 63 | #define TCC_OUTPUT_DLL 3 /* dynamic library */ 64 | #define TCC_OUTPUT_OBJ 4 /* object file */ 65 | #define TCC_OUTPUT_PREPROCESS 5 /* only preprocess (used internally) */ 66 | 67 | /* equivalent to -Lpath option */ 68 | LIBTCCAPI int tcc_add_library_path(TCCState *s, const char *pathname); 69 | 70 | /* the library name is the same as the argument of the '-l' option */ 71 | LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname); 72 | 73 | /* add a symbol to the compiled program */ 74 | LIBTCCAPI int tcc_add_symbol(TCCState *s, const char *name, const void *val); 75 | 76 | /* output an executable, library or object file. DO NOT call 77 | tcc_relocate() before. */ 78 | LIBTCCAPI int tcc_output_file(TCCState *s, const char *filename); 79 | 80 | /* link and run main() function and return its value. DO NOT call 81 | tcc_relocate() before. */ 82 | LIBTCCAPI int tcc_run(TCCState *s, int argc, char **argv); 83 | 84 | /* do all relocations (needed before using tcc_get_symbol()) */ 85 | LIBTCCAPI int tcc_relocate(TCCState *s1, void *ptr); 86 | /* possible values for 'ptr': 87 | - TCC_RELOCATE_AUTO : Allocate and manage memory internally 88 | - NULL : return required memory size for the step below 89 | - memory address : copy code to memory passed by the caller 90 | returns -1 if error. */ 91 | #define TCC_RELOCATE_AUTO (void*)1 92 | 93 | /* return symbol value or NULL if not found */ 94 | LIBTCCAPI void *tcc_get_symbol(TCCState *s, const char *name); 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 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 extern __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 | #define __TRY__ 80 | #else 81 | #define __stdcall __attribute__((__stdcall__)) 82 | #define _X86_ 1 83 | #define _M_IX86 300 /* Visual Studio */ 84 | #define WIN32 1 85 | #define _USE_32BIT_TIME_T 86 | #ifdef __arm__ 87 | #define __TRY__ 88 | #else 89 | #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec); 90 | #endif 91 | #endif 92 | 93 | /* in stddef.h */ 94 | #define _SIZE_T_DEFINED 95 | #define _SSIZE_T_DEFINED 96 | #define _PTRDIFF_T_DEFINED 97 | #define _WCHAR_T_DEFINED 98 | #define _UINTPTR_T_DEFINED 99 | #define _INTPTR_T_DEFINED 100 | #define _INTEGRAL_MAX_BITS 64 101 | 102 | #ifndef _TIME32_T_DEFINED 103 | #define _TIME32_T_DEFINED 104 | typedef long __time32_t; 105 | #endif 106 | 107 | #ifndef _TIME64_T_DEFINED 108 | #define _TIME64_T_DEFINED 109 | typedef long long __time64_t; 110 | #endif 111 | 112 | #ifndef _TIME_T_DEFINED 113 | #define _TIME_T_DEFINED 114 | #ifdef _USE_32BIT_TIME_T 115 | typedef __time32_t time_t; 116 | #else 117 | typedef __time64_t time_t; 118 | #endif 119 | #endif 120 | 121 | #ifndef _WCTYPE_T_DEFINED 122 | #define _WCTYPE_T_DEFINED 123 | typedef wchar_t wctype_t; 124 | #endif 125 | 126 | #ifndef _WINT_T 127 | #define _WINT_T 128 | typedef __WINT_TYPE__ wint_t; 129 | #endif 130 | 131 | typedef int errno_t; 132 | #define _ERRCODE_DEFINED 133 | 134 | typedef struct threadlocaleinfostruct *pthreadlocinfo; 135 | typedef struct threadmbcinfostruct *pthreadmbcinfo; 136 | typedef struct localeinfo_struct _locale_tstruct,*_locale_t; 137 | 138 | /* for winapi */ 139 | #define _ANONYMOUS_UNION 140 | #define _ANONYMOUS_STRUCT 141 | #define DECLSPEC_NORETURN 142 | #define DECLARE_STDCALL_P(type) __stdcall type 143 | #define NOSERVICE 1 144 | #define NOMCX 1 145 | #define NOIME 1 146 | #define __INTRIN_H_ 147 | #ifndef DUMMYUNIONNAME 148 | # define DUMMYUNIONNAME 149 | # define DUMMYUNIONNAME1 150 | # define DUMMYUNIONNAME2 151 | # define DUMMYUNIONNAME3 152 | # define DUMMYUNIONNAME4 153 | # define DUMMYUNIONNAME5 154 | #endif 155 | #ifndef DUMMYSTRUCTNAME 156 | # define DUMMYSTRUCTNAME 157 | #endif 158 | #ifndef WINVER 159 | # define WINVER 0x0502 160 | #endif 161 | #ifndef _WIN32_WINNT 162 | # define _WIN32_WINNT 0x502 163 | #endif 164 | 165 | #define __C89_NAMELESS 166 | #define __MINGW_EXTENSION 167 | #define WINAPI_FAMILY_PARTITION(X) 1 168 | #define MINGW_HAS_SECURE_API 169 | 170 | #endif /* __MINGW_H */ 171 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/examples/hello_win.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // HELLO_WIN.C - Windows GUI 'Hello World!' Example 4 | // 5 | //+--------------------------------------------------------------------------- 6 | 7 | #include 8 | 9 | #define APPNAME "HELLO_WIN" 10 | 11 | char szAppName[] = APPNAME; // The name of this application 12 | char szTitle[] = APPNAME; // The title bar text 13 | const char *pWindowText; 14 | 15 | void CenterWindow(HWND hWnd); 16 | 17 | //+--------------------------------------------------------------------------- 18 | // 19 | // Function: WndProc 20 | // 21 | // Synopsis: very unusual type of function - gets called by system to 22 | // process windows messages. 23 | // 24 | // Arguments: same as always. 25 | //---------------------------------------------------------------------------- 26 | 27 | LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 28 | { 29 | switch (message) { 30 | 31 | // ----------------------- first and last 32 | case WM_CREATE: 33 | CenterWindow(hwnd); 34 | break; 35 | 36 | case WM_DESTROY: 37 | PostQuitMessage(0); 38 | break; 39 | 40 | // ----------------------- get out of it... 41 | case WM_RBUTTONUP: 42 | DestroyWindow(hwnd); 43 | break; 44 | 45 | case WM_KEYDOWN: 46 | if (VK_ESCAPE == wParam) 47 | DestroyWindow(hwnd); 48 | break; 49 | 50 | // ----------------------- display our minimal info 51 | case WM_PAINT: 52 | { 53 | PAINTSTRUCT ps; 54 | HDC hdc; 55 | RECT rc; 56 | hdc = BeginPaint(hwnd, &ps); 57 | 58 | GetClientRect(hwnd, &rc); 59 | SetTextColor(hdc, RGB(240,240,96)); 60 | SetBkMode(hdc, TRANSPARENT); 61 | DrawText(hdc, pWindowText, -1, &rc, DT_CENTER|DT_SINGLELINE|DT_VCENTER); 62 | 63 | EndPaint(hwnd, &ps); 64 | break; 65 | } 66 | 67 | // ----------------------- let windows do all other stuff 68 | default: 69 | return DefWindowProc(hwnd, message, wParam, lParam); 70 | } 71 | return 0; 72 | } 73 | 74 | //+--------------------------------------------------------------------------- 75 | // 76 | // Function: WinMain 77 | // 78 | // Synopsis: standard entrypoint for GUI Win32 apps 79 | // 80 | //---------------------------------------------------------------------------- 81 | int APIENTRY WinMain( 82 | HINSTANCE hInstance, 83 | HINSTANCE hPrevInstance, 84 | LPSTR lpCmdLine, 85 | int nCmdShow 86 | ) 87 | { 88 | MSG msg; 89 | WNDCLASS wc; 90 | HWND hwnd; 91 | 92 | pWindowText = lpCmdLine[0] ? lpCmdLine : "Hello Windows!"; 93 | 94 | // Fill in window class structure with parameters that describe 95 | // the main window. 96 | 97 | ZeroMemory(&wc, sizeof wc); 98 | wc.hInstance = hInstance; 99 | wc.lpszClassName = szAppName; 100 | wc.lpfnWndProc = (WNDPROC)WndProc; 101 | wc.style = CS_DBLCLKS|CS_VREDRAW|CS_HREDRAW; 102 | wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); 103 | wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); 104 | wc.hCursor = LoadCursor(NULL, IDC_ARROW); 105 | 106 | if (FALSE == RegisterClass(&wc)) 107 | return 0; 108 | 109 | // create the browser 110 | hwnd = CreateWindow( 111 | szAppName, 112 | szTitle, 113 | WS_OVERLAPPEDWINDOW|WS_VISIBLE, 114 | CW_USEDEFAULT, 115 | CW_USEDEFAULT, 116 | 360,//CW_USEDEFAULT, 117 | 240,//CW_USEDEFAULT, 118 | 0, 119 | 0, 120 | hInstance, 121 | 0); 122 | 123 | if (NULL == hwnd) 124 | return 0; 125 | 126 | // Main message loop: 127 | while (GetMessage(&msg, NULL, 0, 0) > 0) { 128 | TranslateMessage(&msg); 129 | DispatchMessage(&msg); 130 | } 131 | 132 | return msg.wParam; 133 | } 134 | 135 | //+--------------------------------------------------------------------------- 136 | 137 | //+--------------------------------------------------------------------------- 138 | 139 | void CenterWindow(HWND hwnd_self) 140 | { 141 | HWND hwnd_parent; 142 | RECT rw_self, rc_parent, rw_parent; 143 | int xpos, ypos; 144 | 145 | hwnd_parent = GetParent(hwnd_self); 146 | if (NULL == hwnd_parent) 147 | hwnd_parent = GetDesktopWindow(); 148 | 149 | GetWindowRect(hwnd_parent, &rw_parent); 150 | GetClientRect(hwnd_parent, &rc_parent); 151 | GetWindowRect(hwnd_self, &rw_self); 152 | 153 | xpos = rw_parent.left + (rc_parent.right + rw_self.left - rw_self.right) / 2; 154 | ypos = rw_parent.top + (rc_parent.bottom + rw_self.top - rw_self.bottom) / 2; 155 | 156 | SetWindowPos( 157 | hwnd_self, NULL, 158 | xpos, ypos, 0, 0, 159 | SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE 160 | ); 161 | } 162 | 163 | //+--------------------------------------------------------------------------- 164 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/doc/tcc-win32.txt: -------------------------------------------------------------------------------- 1 | 2 | TinyCC 3 | ====== 4 | 5 | This file contains specific information for usage of TinyCC 6 | under MS-Windows. See tcc-doc.html to have all the features. 7 | 8 | 9 | Installation from the binary ZIP package: 10 | ----------------------------------------- 11 | Unzip the package to a directory of your choice. 12 | 13 | 14 | Set the system PATH: 15 | -------------------- 16 | To be able to invoke the compiler from everywhere on your computer by 17 | just typing "tcc", please add the directory containing tcc.exe to your 18 | system PATH. 19 | 20 | 21 | Include and library search paths 22 | -------------------------------- 23 | On windows, the standard "include" and "lib" directories are searched 24 | relatively from the location of the executables (tcc.exe, libtcc.dll). 25 | 26 | 27 | Examples: 28 | --------- 29 | Open a console window (DOS box) and 'cd' to the examples directory. 30 | 31 | For the 'Fibonacci' example type: 32 | 33 | tcc fib.c 34 | 35 | For the 'Hello Windows' GUI example type: 36 | 37 | tcc hello_win.c 38 | 39 | For the 'Hello DLL' example type 40 | 41 | tcc -shared dll.c 42 | tcc -impdef dll.dll (optional) 43 | tcc hello_dll.c dll.def 44 | 45 | 46 | Using libtcc as JIT compiler in your program 47 | -------------------------------------------- 48 | Check out the 'libtcc_test' example: 49 | 50 | - Running it from source: 51 | tcc -I libtcc libtcc/libtcc.def -run examples/libtcc_test.c 52 | 53 | - Compiling with TCC: 54 | tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def 55 | 56 | - Compiling with MinGW: 57 | gcc examples/libtcc_test.c -I libtcc libtcc.dll -o libtcc_test.exe 58 | 59 | - Compiling with MSVC: 60 | lib /def:libtcc\libtcc.def /out:libtcc.lib 61 | cl /MD examples/libtcc_test.c -I libtcc libtcc.lib 62 | 63 | 64 | Import Definition Files: 65 | ------------------------ 66 | To link with Windows system DLLs, TCC uses import definition 67 | files (.def) instead of libraries. 68 | 69 | The now built-in 'tiny_impdef' program may be used to make 70 | additional .def files for any DLL. For example 71 | 72 | tcc -impdef [-v] opengl32.dll [-o opengl32.def] 73 | 74 | Put opengl32.def into the tcc/lib directory. Specify -lopengl32 at 75 | the TCC commandline to link a program that uses opengl32.dll. 76 | 77 | 78 | Header Files: 79 | ------------- 80 | The system header files (except _mingw.h) are from the MinGW 81 | distribution: 82 | 83 | http://www.mingw.org/ 84 | 85 | From the windows headers, only a minimal set is included. If you need 86 | more, get MinGW's "w32api" package. Extract the files from "include" 87 | into your "tcc/include/winapi" directory. 88 | 89 | 90 | Resource Files: 91 | --------------- 92 | TCC can link windows resources in coff format as generated by MinGW's 93 | windres.exe. For example: 94 | 95 | windres -O coff app.rc -o appres.o 96 | tcc app.c appres.o -o app.exe 97 | 98 | 99 | Tiny Libmaker: 100 | -------------- 101 | The now built-in tiny_libmaker tool by Timovj Lahde can be used as 102 | 'ar' replacement to make a library from several object files: 103 | 104 | tcc -ar [rcsv] library objectfiles ... 105 | 106 | 107 | Compilation from source: 108 | ------------------------ 109 | * You can use the MinGW and MSYS tools available at 110 | http://www.mingw.org 111 | http://www.mingw-w64.org 112 | http://www.msys2.org 113 | 114 | Untar the TCC archive and type in the MSYS shell: 115 | ./configure [--prefix installpath] 116 | make 117 | make install 118 | 119 | The default install location is c:\Program Files\tcc 120 | 121 | Cygwin can be used too with its mingw cross-compiler installed: 122 | ./configure --cross-prefix=i686-w64-mingw32- 123 | (the prefix may vary) 124 | 125 | * Alternatively you can compile TCC with just GCC from MinGW using 126 | > build-tcc.bat (from the win32 directory) 127 | 128 | Also MSVC can be used with the "VSTools Developer Command Prompt": 129 | > build-tcc.bat -c cl 130 | 131 | or with an existing tcc (needs to be in a different directory) 132 | > build-tcc.bat -c some-tcc-dir\tcc.exe 133 | 134 | Also you can copy/install everything into another directory: 135 | > build-tcc.bat -i 136 | 137 | Limitations: 138 | ------------ 139 | - On the object file level, currently TCC supports only the ELF format, 140 | not COFF as used by MinGW and MSVC. It is not possible to exchange 141 | object files or libraries between TCC and these compilers. 142 | 143 | However libraries for TCC from objects by TCC can be made using 144 | tcc -ar lib.a files.o ,,, 145 | 146 | - No leading underscore is generated in the ELF symbols. 147 | 148 | Documentation and License: 149 | -------------------------- 150 | TCC is distributed under the GNU Lesser General Public License. (See 151 | COPYING file or http://www.gnu.org/licenses/lgpl-2.1.html) 152 | 153 | TinyCC homepage is at: 154 | 155 | http://fabrice.bellard.free.fr/tcc/ 156 | 157 | 158 | WinAPI Help and 3rd-party tools: 159 | -------------------------------- 160 | The Windows API documentation (Win95) in a single .hlp file is 161 | available on the lcc-win32 site as "win32hlp.exe" or from other 162 | locations as "win32hlp_big.zip". 163 | 164 | A nice RAD tool to create windows resources (dialog boxes etc.) is 165 | "ResEd", available at the RadASM website. 166 | 167 | 168 | --- grischka 169 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/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 | -------------------------------------------------------------------------------- /tcc/include/sys/stat.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_STAT 7 | #define _INC_STAT 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | #include 15 | 16 | #pragma pack(push,_CRT_PACKING) 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #ifndef _CRTIMP 23 | #define _CRTIMP __declspec(dllimport) 24 | #endif 25 | 26 | #include 27 | 28 | #ifndef __TINYC__ /* gr */ 29 | #ifdef _USE_32BIT_TIME_T 30 | #ifdef _WIN64 31 | #undef _USE_32BIT_TIME_T 32 | #endif 33 | #else 34 | #if _INTEGRAL_MAX_BITS < 64 35 | #define _USE_32BIT_TIME_T 36 | #endif 37 | #endif 38 | #endif 39 | 40 | #ifndef _TIME32_T_DEFINED 41 | typedef long __time32_t; 42 | #define _TIME32_T_DEFINED 43 | #endif 44 | 45 | #ifndef _TIME64_T_DEFINED 46 | #if _INTEGRAL_MAX_BITS >= 64 47 | typedef __int64 __time64_t; 48 | #endif 49 | #define _TIME64_T_DEFINED 50 | #endif 51 | 52 | #ifndef _TIME_T_DEFINED 53 | #ifdef _USE_32BIT_TIME_T 54 | typedef __time32_t time_t; 55 | #else 56 | typedef __time64_t time_t; 57 | #endif 58 | #define _TIME_T_DEFINED 59 | #endif 60 | 61 | #ifndef _WCHAR_T_DEFINED 62 | typedef unsigned short wchar_t; 63 | #define _WCHAR_T_DEFINED 64 | #endif 65 | 66 | #ifndef _STAT_DEFINED 67 | 68 | #ifdef _USE_32BIT_TIME_T 69 | #ifndef _WIN64 70 | #define _fstat32 _fstat 71 | #define _stat32 _stat 72 | #define _wstat32 _wstat 73 | #else 74 | #define _fstat _fstat32 75 | #define _stat _stat32 76 | #define _wstat _wstat32 77 | #endif 78 | #define _fstati64 _fstat32i64 79 | #define _stati64 _stat32i64 80 | #define _wstati64 _wstat32i64 81 | #else 82 | #define _fstat _fstat64i32 83 | #define _fstati64 _fstat64 84 | #define _stat _stat64i32 85 | #define _stati64 _stat64 86 | #define _wstat _wstat64i32 87 | #define _wstati64 _wstat64 88 | #endif 89 | 90 | struct _stat32 { 91 | _dev_t st_dev; 92 | _ino_t st_ino; 93 | unsigned short st_mode; 94 | short st_nlink; 95 | short st_uid; 96 | short st_gid; 97 | _dev_t st_rdev; 98 | _off_t st_size; 99 | __time32_t st_atime; 100 | __time32_t st_mtime; 101 | __time32_t st_ctime; 102 | }; 103 | 104 | #ifndef NO_OLDNAMES 105 | struct stat { 106 | _dev_t st_dev; 107 | _ino_t st_ino; 108 | unsigned short st_mode; 109 | short st_nlink; 110 | short st_uid; 111 | short st_gid; 112 | _dev_t st_rdev; 113 | _off_t st_size; 114 | time_t st_atime; 115 | time_t st_mtime; 116 | time_t st_ctime; 117 | }; 118 | #endif 119 | 120 | #if _INTEGRAL_MAX_BITS >= 64 121 | struct _stat32i64 { 122 | _dev_t st_dev; 123 | _ino_t st_ino; 124 | unsigned short st_mode; 125 | short st_nlink; 126 | short st_uid; 127 | short st_gid; 128 | _dev_t st_rdev; 129 | __int64 st_size; 130 | __time32_t st_atime; 131 | __time32_t st_mtime; 132 | __time32_t st_ctime; 133 | }; 134 | 135 | struct _stat64i32 { 136 | _dev_t st_dev; 137 | _ino_t st_ino; 138 | unsigned short st_mode; 139 | short st_nlink; 140 | short st_uid; 141 | short st_gid; 142 | _dev_t st_rdev; 143 | _off_t st_size; 144 | __time64_t st_atime; 145 | __time64_t st_mtime; 146 | __time64_t st_ctime; 147 | }; 148 | 149 | struct _stat64 { 150 | _dev_t st_dev; 151 | _ino_t st_ino; 152 | unsigned short st_mode; 153 | short st_nlink; 154 | short st_uid; 155 | short st_gid; 156 | _dev_t st_rdev; 157 | __int64 st_size; 158 | __time64_t st_atime; 159 | __time64_t st_mtime; 160 | __time64_t st_ctime; 161 | }; 162 | #endif 163 | 164 | #define __stat64 _stat64 165 | 166 | #define _STAT_DEFINED 167 | #endif 168 | 169 | #define _S_IFMT 0xF000 170 | #define _S_IFDIR 0x4000 171 | #define _S_IFCHR 0x2000 172 | #define _S_IFIFO 0x1000 173 | #define _S_IFREG 0x8000 174 | #define _S_IREAD 0x0100 175 | #define _S_IWRITE 0x0080 176 | #define _S_IEXEC 0x0040 177 | 178 | _CRTIMP int __cdecl _fstat32(int _FileDes,struct _stat32 *_Stat); 179 | _CRTIMP int __cdecl _stat32(const char *_Name,struct _stat32 *_Stat); 180 | #if _INTEGRAL_MAX_BITS >= 64 181 | _CRTIMP int __cdecl _fstat64(int _FileDes,struct _stat64 *_Stat); 182 | _CRTIMP int __cdecl _fstat32i64(int _FileDes,struct _stat32i64 *_Stat); 183 | int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat); 184 | __CRT_INLINE int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat) 185 | { 186 | struct _stat64 st; 187 | int ret=_fstat64(_FileDes,&st); 188 | _Stat->st_dev=st.st_dev; 189 | _Stat->st_ino=st.st_ino; 190 | _Stat->st_mode=st.st_mode; 191 | _Stat->st_nlink=st.st_nlink; 192 | _Stat->st_uid=st.st_uid; 193 | _Stat->st_gid=st.st_gid; 194 | _Stat->st_rdev=st.st_rdev; 195 | _Stat->st_size=(_off_t) st.st_size; 196 | _Stat->st_atime=st.st_atime; 197 | _Stat->st_mtime=st.st_mtime; 198 | _Stat->st_ctime=st.st_ctime; 199 | return ret; 200 | } 201 | _CRTIMP int __cdecl _stat64(const char *_Name,struct _stat64 *_Stat); 202 | _CRTIMP int __cdecl _stat32i64(const char *_Name,struct _stat32i64 *_Stat); 203 | int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat); 204 | __CRT_INLINE int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat) 205 | { 206 | struct _stat64 st; 207 | int ret=_stat64(_Name,&st); 208 | _Stat->st_dev=st.st_dev; 209 | _Stat->st_ino=st.st_ino; 210 | _Stat->st_mode=st.st_mode; 211 | _Stat->st_nlink=st.st_nlink; 212 | _Stat->st_uid=st.st_uid; 213 | _Stat->st_gid=st.st_gid; 214 | _Stat->st_rdev=st.st_rdev; 215 | _Stat->st_size=(_off_t) st.st_size; 216 | _Stat->st_atime=st.st_atime; 217 | _Stat->st_mtime=st.st_mtime; 218 | _Stat->st_ctime=st.st_ctime; 219 | return ret; 220 | } 221 | #endif 222 | 223 | #ifndef _WSTAT_DEFINED 224 | #define _WSTAT_DEFINED 225 | _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat); 226 | #if _INTEGRAL_MAX_BITS >= 64 227 | _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat); 228 | int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat); 229 | _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat); 230 | #endif 231 | #endif 232 | 233 | #ifndef NO_OLDNAMES 234 | #define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */ 235 | 236 | #define S_IFMT _S_IFMT 237 | #define S_IFDIR _S_IFDIR 238 | #define S_IFCHR _S_IFCHR 239 | #define S_IFREG _S_IFREG 240 | #define S_IREAD _S_IREAD 241 | #define S_IWRITE _S_IWRITE 242 | #define S_IEXEC _S_IEXEC 243 | #define S_IFIFO _S_IFIFO 244 | #define S_IFBLK _S_IFBLK 245 | 246 | #define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC) 247 | #define _S_IXUSR _S_IEXEC 248 | #define _S_IWUSR _S_IWRITE 249 | 250 | #define S_IRWXU _S_IRWXU 251 | #define S_IXUSR _S_IXUSR 252 | #define S_IWUSR _S_IWUSR 253 | #define S_IRUSR _S_IRUSR 254 | #define _S_IRUSR _S_IREAD 255 | 256 | #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 257 | #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) 258 | #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) 259 | #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) 260 | #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 261 | 262 | #endif 263 | 264 | #if !defined (RC_INVOKED) && !defined (NO_OLDNAMES) 265 | int __cdecl stat(const char *_Filename,struct stat *_Stat); 266 | int __cdecl fstat(int _Desc,struct stat *_Stat); 267 | int __cdecl wstat(const wchar_t *_Filename,struct stat *_Stat); 268 | #ifdef _USE_32BIT_TIME_T 269 | __CRT_INLINE int __cdecl fstat(int _Desc,struct stat *_Stat) { 270 | return _fstat32(_Desc,(struct _stat32 *)_Stat); 271 | } 272 | __CRT_INLINE int __cdecl stat(const char *_Filename,struct stat *_Stat) { 273 | return _stat32(_Filename,(struct _stat32 *)_Stat); 274 | } 275 | #else 276 | __CRT_INLINE int __cdecl fstat(int _Desc,struct stat *_Stat) { 277 | return _fstat64i32(_Desc,(struct _stat64i32 *)_Stat); 278 | } 279 | __CRT_INLINE int __cdecl stat(const char *_Filename,struct stat *_Stat) { 280 | return _stat64i32(_Filename,(struct _stat64i32 *)_Stat); 281 | } 282 | #endif 283 | #endif 284 | 285 | #ifdef __cplusplus 286 | } 287 | #endif 288 | 289 | #pragma pack(pop) 290 | #endif 291 | -------------------------------------------------------------------------------- /tcc/include/string.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 7 | #define _INC_STRING 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _NLSCMP_DEFINED 16 | #define _NLSCMP_DEFINED 17 | #define _NLSCMPERROR 2147483647 18 | #endif 19 | 20 | #ifndef NULL 21 | #ifdef __cplusplus 22 | #define NULL 0 23 | #else 24 | #define NULL ((void *)0) 25 | #endif 26 | #endif 27 | 28 | #define _WConst_return _CONST_RETURN 29 | 30 | #ifndef _CRT_MEMORY_DEFINED 31 | #define _CRT_MEMORY_DEFINED 32 | _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount); 33 | _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount); 34 | _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); 35 | _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale); 36 | int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size); 37 | void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size); 38 | void *__cdecl memset(void *_Dst,int _Val,size_t _Size); 39 | #ifndef NO_OLDNAMES 40 | void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size); 41 | int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); 42 | #endif 43 | #endif 44 | char *__cdecl _strset(char *_Str,int _Val); 45 | char *__cdecl strcpy(char *_Dest,const char *_Source); 46 | char *__cdecl strcat(char *_Dest,const char *_Source); 47 | int __cdecl strcmp(const char *_Str1,const char *_Str2); 48 | size_t __cdecl strlen(const char *_Str); 49 | #if 0 50 | size_t __cdecl strnlen(const char *_Str,size_t _MaxCount); 51 | #endif 52 | void *__cdecl memmove(void *_Dst,const void *_Src,size_t _Size); 53 | _CRTIMP char *__cdecl _strdup(const char *_Src); 54 | _CONST_RETURN char *__cdecl strchr(const char *_Str,int _Val); 55 | _CRTIMP int __cdecl _stricmp(const char *_Str1,const char *_Str2); 56 | _CRTIMP int __cdecl _strcmpi(const char *_Str1,const char *_Str2); 57 | _CRTIMP int __cdecl _stricmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale); 58 | int __cdecl strcoll(const char *_Str1,const char *_Str2); 59 | _CRTIMP int __cdecl _strcoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale); 60 | _CRTIMP int __cdecl _stricoll(const char *_Str1,const char *_Str2); 61 | _CRTIMP int __cdecl _stricoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale); 62 | _CRTIMP int __cdecl _strncoll (const char *_Str1,const char *_Str2,size_t _MaxCount); 63 | _CRTIMP int __cdecl _strncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); 64 | _CRTIMP int __cdecl _strnicoll (const char *_Str1,const char *_Str2,size_t _MaxCount); 65 | _CRTIMP int __cdecl _strnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); 66 | size_t __cdecl strcspn(const char *_Str,const char *_Control); 67 | _CRTIMP char *__cdecl _strerror(const char *_ErrMsg); 68 | char *__cdecl strerror(int); 69 | _CRTIMP char *__cdecl _strlwr(char *_String); 70 | char *strlwr_l(char *_String,_locale_t _Locale); 71 | char *__cdecl strncat(char *_Dest,const char *_Source,size_t _Count); 72 | int __cdecl strncmp(const char *_Str1,const char *_Str2,size_t _MaxCount); 73 | _CRTIMP int __cdecl _strnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount); 74 | _CRTIMP int __cdecl _strnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); 75 | char *strncpy(char *_Dest,const char *_Source,size_t _Count); 76 | _CRTIMP char *__cdecl _strnset(char *_Str,int _Val,size_t _MaxCount); 77 | _CONST_RETURN char *__cdecl strpbrk(const char *_Str,const char *_Control); 78 | _CONST_RETURN char *__cdecl strrchr(const char *_Str,int _Ch); 79 | _CRTIMP char *__cdecl _strrev(char *_Str); 80 | size_t __cdecl strspn(const char *_Str,const char *_Control); 81 | _CONST_RETURN char *__cdecl strstr(const char *_Str,const char *_SubStr); 82 | char *__cdecl strtok(char *_Str,const char *_Delim); 83 | _CRTIMP char *__cdecl _strupr(char *_String); 84 | _CRTIMP char *_strupr_l(char *_String,_locale_t _Locale); 85 | size_t __cdecl strxfrm(char *_Dst,const char *_Src,size_t _MaxCount); 86 | _CRTIMP size_t __cdecl _strxfrm_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale); 87 | 88 | #ifndef NO_OLDNAMES 89 | char *__cdecl strdup(const char *_Src); 90 | int __cdecl strcmpi(const char *_Str1,const char *_Str2); 91 | int __cdecl stricmp(const char *_Str1,const char *_Str2); 92 | char *__cdecl strlwr(char *_Str); 93 | int __cdecl strnicmp(const char *_Str1,const char *_Str,size_t _MaxCount); 94 | __CRT_INLINE int __cdecl strncasecmp (const char *__sz1, const char *__sz2, size_t __sizeMaxCompare) { return _strnicmp (__sz1, __sz2, __sizeMaxCompare); } 95 | __CRT_INLINE int __cdecl strcasecmp (const char *__sz1, const char *__sz2) { return _stricmp (__sz1, __sz2); } 96 | char *__cdecl strnset(char *_Str,int _Val,size_t _MaxCount); 97 | char *__cdecl strrev(char *_Str); 98 | char *__cdecl strset(char *_Str,int _Val); 99 | char *__cdecl strupr(char *_Str); 100 | #endif 101 | 102 | #ifndef _WSTRING_DEFINED 103 | #define _WSTRING_DEFINED 104 | 105 | _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str); 106 | wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source); 107 | _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch); 108 | int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2); 109 | wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source); 110 | size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control); 111 | size_t __cdecl wcslen(const wchar_t *_Str); 112 | size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount); 113 | wchar_t *wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); 114 | int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 115 | wchar_t *wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); 116 | _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control); 117 | _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch); 118 | size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control); 119 | _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr); 120 | wchar_t *__cdecl wcstok(wchar_t *_Str,const wchar_t *_Delim); 121 | _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum); 122 | _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str); 123 | _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); 124 | _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); 125 | _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 126 | _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); 127 | _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount); 128 | _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str); 129 | _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val); 130 | _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String); 131 | _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale); 132 | _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String); 133 | _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale); 134 | size_t __cdecl wcsxfrm(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount); 135 | _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale); 136 | int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2); 137 | _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); 138 | _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); 139 | _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); 140 | _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 141 | _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); 142 | _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 143 | _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); 144 | 145 | #ifndef NO_OLDNAMES 146 | wchar_t *__cdecl wcsdup(const wchar_t *_Str); 147 | #define wcswcs wcsstr 148 | int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); 149 | int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 150 | wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount); 151 | wchar_t *__cdecl wcsrev(wchar_t *_Str); 152 | wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val); 153 | wchar_t *__cdecl wcslwr(wchar_t *_Str); 154 | wchar_t *__cdecl wcsupr(wchar_t *_Str); 155 | int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); 156 | #endif 157 | #endif 158 | 159 | #ifdef __cplusplus 160 | } 161 | #endif 162 | 163 | #include 164 | #endif 165 | --------------------------------------------------------------------------------