From 73faaea227a53e365dd75f1dba7a5071c7b5e541 Mon Sep 17 00:00:00 2001 From: grischka Date: Wed, 28 Aug 2013 22:55:05 +0200 Subject: i386-gen: preserve fp control word in gen_cvt_ftoi - Use runtime function for conversion - Also initialize fp with tcc -run on windows This fixes a bug where double x = 1.0; double y = 1.0000000000000001; double z = x < y ? 0 : sqrt (x*x - y*y); caused a bad sqrt because rounding precision for the x < y comparison was different to the one used within the sqrt function. This also fixes a bug where printf("%d, %d", (int)pow(10, 2), (int)pow(10, 2)); would print 100, 99 Unrelated: win32: document relative include & lib lookup win32: normalize_slashes: do not mirror silly gcc behavior This reverts part of commit 8a81f9e1036637e21a47e14fb56bf64133546890 winapi: add missing WINAPI decl. for some functions --- win32/include/winapi/winbase.h | 12 ++++++------ win32/lib/crt1.c | 6 ++++++ win32/lib/wincrt1.c | 2 +- win32/tcc-win32.txt | 6 ++++++ 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'win32') diff --git a/win32/include/winapi/winbase.h b/win32/include/winapi/winbase.h index a5d9b17..4a38006 100644 --- a/win32/include/winapi/winbase.h +++ b/win32/include/winapi/winbase.h @@ -968,15 +968,15 @@ extern "C" { LONG64 InterlockedExchangeAdd64(LONG64 volatile *Addend,LONG64 Value); LONG64 InterlockedCompareExchange64(LONG64 volatile *Destination,LONG64 ExChange,LONG64 Comperand); #else - LONG InterlockedIncrement(LONG volatile *lpAddend); - LONG InterlockedDecrement(LONG volatile *lpAddend); - LONG InterlockedExchange(LONG volatile *Target,LONG Value); + LONG WINAPI InterlockedIncrement(LONG volatile *lpAddend); + LONG WINAPI InterlockedDecrement(LONG volatile *lpAddend); + LONG WINAPI InterlockedExchange(LONG volatile *Target,LONG Value); #define InterlockedExchangePointer(Target,Value) (PVOID)InterlockedExchange((PLONG)(Target),(LONG)(Value)) - LONG InterlockedExchangeAdd(LONG volatile *Addend,LONG Value); - LONG InterlockedCompareExchange(LONG volatile *Destination,LONG Exchange,LONG Comperand); - LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination,LONGLONG Exchange,LONGLONG Comperand); + LONG WINAPI InterlockedExchangeAdd(LONG volatile *Addend,LONG Value); + LONG WINAPI InterlockedCompareExchange(LONG volatile *Destination,LONG Exchange,LONG Comperand); + LONGLONG WINAPI InterlockedCompareExchange64(LONGLONG volatile *Destination,LONGLONG Exchange,LONGLONG Comperand); __CRT_INLINE LONGLONG InterlockedAnd64 (LONGLONG volatile *Destination,LONGLONG Value) { LONGLONG Old; diff --git a/win32/lib/crt1.c b/win32/lib/crt1.c index 3e1d17f..cde3910 100644 --- a/win32/lib/crt1.c +++ b/win32/lib/crt1.c @@ -31,4 +31,10 @@ int _start(void) exit(ret); } +int _runmain(int argc, char **argv) +{ + _controlfp(0x10000, 0x30000); + return main(argc, argv, NULL); +} + // ============================================= diff --git a/win32/lib/wincrt1.c b/win32/lib/wincrt1.c index 77e74b8..663fd33 100644 --- a/win32/lib/wincrt1.c +++ b/win32/lib/wincrt1.c @@ -59,6 +59,6 @@ int _runwinmain(int argc, char **argv) szCmd = ""; else if (szCmd > p && szCmd[-1] == '\"') --szCmd; + _controlfp(0x10000, 0x30000); return WinMain(GetModuleHandle(NULL), NULL, szCmd, SW_SHOWDEFAULT); } - diff --git a/win32/tcc-win32.txt b/win32/tcc-win32.txt index dc06b8f..1cb35c5 100644 --- a/win32/tcc-win32.txt +++ b/win32/tcc-win32.txt @@ -18,6 +18,12 @@ system PATH. + Include and library search paths + -------------------------------- + On windows, the standard "include" and "lib" directories are searched + relatively from the location of the executables (tcc.exe, libtcc.dll). + + Examples: --------- Open a console window (DOS box) and 'cd' to the examples directory. -- cgit v1.3.1 From 13b997668e32a4b451783fd80525cf221149c5b3 Mon Sep 17 00:00:00 2001 From: grischka Date: Tue, 10 Sep 2013 15:36:56 +0200 Subject: win32: fix libtcc support For "tcc -run file.c", I was trying to initialize the FP control in a function in libtcc1.a (_runmain) before calling main. Unfortunately that turned out to cause problems with for example libtcc_test since such usage doesn't necessarily define a 'main' function. So for tcc -run we're back to relying on the FP control word that is set in the startup code of tcc.exe rsp. libtcc.dll. This fixes part of commit 73faaea227a53e365dd75f1dba7a5071c7b5e541 --- tccpe.c | 7 ++++--- win32/lib/crt1.c | 6 ------ 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'win32') diff --git a/tccpe.c b/tccpe.c index 05fed09..19b20ab 100644 --- a/tccpe.c +++ b/tccpe.c @@ -1741,7 +1741,7 @@ static void pe_add_runtime(TCCState *s1, struct pe_info *pe) start_symbol = TCC_OUTPUT_MEMORY == s1->output_type - ? PE_GUI == pe_type ? "__runwinmain" : "__runmain" + ? PE_GUI == pe_type ? "__runwinmain" : "_main" : PE_DLL == pe_type ? PE_STDSYM("__dllstart","@12") : PE_GUI == pe_type ? "__winstart" : "__start" ; @@ -1750,7 +1750,7 @@ static void pe_add_runtime(TCCState *s1, struct pe_info *pe) ++start_symbol; /* grab the startup code from libtcc1 */ - if (start_symbol) + if (TCC_OUTPUT_MEMORY != s1->output_type || PE_GUI == pe_type) add_elf_sym(symtab_section, 0, 0, ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE), 0, @@ -1775,10 +1775,11 @@ static void pe_add_runtime(TCCState *s1, struct pe_info *pe) if (TCC_OUTPUT_MEMORY == s1->output_type) { pe_type = PE_RUN; s1->runtime_main = start_symbol; + } else { + pe->start_addr = (DWORD)tcc_get_symbol_err(s1, start_symbol); } pe->type = pe_type; - pe->start_addr = (DWORD)tcc_get_symbol_err(s1, start_symbol); } ST_FUNC int pe_output_file(TCCState * s1, const char *filename) diff --git a/win32/lib/crt1.c b/win32/lib/crt1.c index cde3910..3e1d17f 100644 --- a/win32/lib/crt1.c +++ b/win32/lib/crt1.c @@ -31,10 +31,4 @@ int _start(void) exit(ret); } -int _runmain(int argc, char **argv) -{ - _controlfp(0x10000, 0x30000); - return main(argc, argv, NULL); -} - // ============================================= -- cgit v1.3.1 From 642b6d0f50c6b6a842c9239a102fe34d5619e931 Mon Sep 17 00:00:00 2001 From: YX Hao Date: Thu, 19 Sep 2013 21:50:38 +0800 Subject: Add the possibility to use noname functions by ordinal tcc.c: process.h:177:20: note: expected 'char * const*' but argument is of type 'char const*const*' tccpe.c: Add the possibility to use noname functions by ordinal. use def file: "AliasName @n" build-tcc.bat: 1. Enable 32 bits mode on 64 bits OS. 2. build doc. _parseLibs.bat: Convenient to use "*.def + *.c" instead of *.a, just use -l* _tcc.bat: a practice of _parseLibs.bat Signed-off-by: YX Hao --- tcc.c | 2 +- tccpe.c | 38 +++++++++++++++++++++---- win32/_parseLibs.bat | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ win32/_tcc.bat | 30 ++++++++++++++++++++ win32/build-tcc.bat | 9 +++++- 5 files changed, 150 insertions(+), 8 deletions(-) create mode 100644 win32/_parseLibs.bat create mode 100644 win32/_tcc.bat (limited to 'win32') diff --git a/tcc.c b/tcc.c index b223d39..58f9007 100644 --- a/tcc.c +++ b/tcc.c @@ -79,7 +79,7 @@ static void help(void) #include static int execvp_win32(const char *prog, char **argv) { - int ret = spawnvp(P_NOWAIT, prog, (char const*const*)argv); + int ret = spawnvp(P_NOWAIT, prog, (char *const*)argv); if (-1 == ret) return ret; cwait(&ret, ret, WAIT_CHILD); diff --git a/tccpe.c b/tccpe.c index 19b20ab..bc1545e 100644 --- a/tccpe.c +++ b/tccpe.c @@ -813,6 +813,7 @@ static void pe_build_imports(struct pe_info *pe) hdr->Name = v + rva_base; for (k = 0, n = p->sym_count; k <= n; ++k) { + int ordinal = 0; if (k < n) { int iat_index = p->symbols[k]->iat_index; int sym_index = p->symbols[k]->sym_index; @@ -823,25 +824,31 @@ static void pe_build_imports(struct pe_info *pe) org_sym->st_value = thk_ptr; org_sym->st_shndx = pe->thunk->sh_num; v = pe->thunk->data_offset + rva_base; - section_ptr_add(pe->thunk, sizeof(WORD)); /* hint, not used */ - put_elf_str(pe->thunk, name); + + /* ordinal or name */ + ordinal = imp_sym->st_value; /* from pe_load_def, temperary use */ + //if (ordinal) printf("ordinal: %d\n", ordinal); + if (!ordinal) { + section_ptr_add(pe->thunk, sizeof(WORD)); /* hint, not used */ + put_elf_str(pe->thunk, name); + } #ifdef TCC_IS_NATIVE if (pe->type == PE_RUN) { v = imp_sym->st_value; if (dllref) { if ( !dllref->handle ) dllref->handle = LoadLibrary(dllref->name); - v = (ADDR3264)GetProcAddress(dllref->handle, name); + v = (ADDR3264)GetProcAddress(dllref->handle, ordinal?(LPCSTR)NULL+ordinal:name); } if (!v) - tcc_error_noabort("undefined symbol '%s'", name); + tcc_error_noabort("can't build symbol '%s'", name); } #endif } else { v = 0; /* last entry is zero */ } *(ADDR3264*)(pe->thunk->data+thk_ptr) = - *(ADDR3264*)(pe->thunk->data+ent_ptr) = v; + *(ADDR3264*)(pe->thunk->data+ent_ptr) = (ordinal && pe->type != PE_RUN)?(ADDR3264)1<<(sizeof(ADDR3264)*8-1)|ordinal:v; thk_ptr += sizeof (ADDR3264); ent_ptr += sizeof (ADDR3264); } @@ -1590,6 +1597,8 @@ static int pe_load_def(TCCState *s1, int fd) char line[400], dllname[80], *p; for (;;) { + int ord = 0; + char *x, *d, idxstr[8]; p = get_line(line, sizeof line, fd); if (NULL == p) break; @@ -1614,7 +1623,24 @@ static int pe_load_def(TCCState *s1, int fd) ++state; default: - pe_putimport(s1, dllindex, p, 0); + /* get ordianl and will store in sym->st_value */ + d = NULL; + x = strchr(line, ' '); + if (x) x = strchr(line, '@'); + while (x != NULL) { + d =x; + x = strchr(x+1, '@'); + } + if (d) { + ord = atoi(d+1); + itoa(ord, idxstr, 10); + if (strcmp(idxstr, d+1) == 0) { + memset(d, 0, 1); + trimback(p, d); + } else + ord = 0; + } + pe_putimport(s1, dllindex, p, ord); continue; } } diff --git a/win32/_parseLibs.bat b/win32/_parseLibs.bat new file mode 100644 index 0000000..19e8e64 --- /dev/null +++ b/win32/_parseLibs.bat @@ -0,0 +1,79 @@ +@echo off +setlocal enabledelayedexpansion + +pushd %~dp0 + +::Define as main parameters +set _Args_= +set _LIBs_= +set LIBi= + +set ARGSO=-IExt\include -LExt\lib %* + +::This is for the .def file also have a similar name .c file +::.a file will be larger than .def + .c +::*-uuid.c files are suitable to form libuuid.a +::w32api-3.17.2 +:GetRLib +for %%i in (%ARGSO%) do ( + set ARG=%%i + set OPT=!ARG:~0,2! + if "!OPT!"=="-l" ( + set LIB=!ARG:~2! + set LIBi= + if "!LIB!"=="uuid" ( + set LIBi= lib\*uid.c + ) else ( + if "!LIB!"=="vfw32" ( + set LIBi= lib\msvfw32.def lib\avifil32.def lib\avicap32.def + ) else ( + call :GetLibS + ) + ) + if "!LIBi!"=="" ( + set _Args_=!_Args_! %%i + ) else ( + set LIBi=!LIBi:%~dp0=! + set _LIBs_=!_LIBs_! !LIBi! + echo For lib !LIB! will use: + echo !LIBi! + echo. + ) + ) else ( + set _Args_=!_Args_! %%i + ) +) + +::GetRLib End +popd + +tcc.exe !_Args_! !_LIBs_! + +exit /b + +:::::::::: + +:GetLibS +for %%D in (-Llib %ARGSO%) do ( + set ARG_=%%D + set OPT_=!ARG_:~0,2! + set LIBD= + if "!OPT_!"=="-L" ( + set LIBD=!ARG_:~2! + if exist "!LIBD!" call :GetDLib + ) +) +set LIBD= +set OPT_= +set ARG_= +exit /b +::GetLibD End + +:GetDLib +pushd !LIBD! +for /f "usebackq delims=" %%I in (`"dir /b /s !LIB!.c !LIB!_*.c !LIB!.def !LIB!_*.def 2>nul"`) do ( + set LIBi=!LIBi! "%%I" +) +popd +exit /b +::GetDLib End diff --git a/win32/_tcc.bat b/win32/_tcc.bat new file mode 100644 index 0000000..65a7697 --- /dev/null +++ b/win32/_tcc.bat @@ -0,0 +1,30 @@ +@echo off +setlocal enabledelayedexpansion + +pushd %~dp0 + +path %~dp0;%path% + +set EXT=.exe +echo %*|findstr /R /C:"\<-c\>" >nul &&set EXT=.o +echo %*|findstr /R /C:"\<-shared\>" >nul &&set EXT=.dll + +::1st file found must be the main c file to get output file name +set OUTF= +call :FINDFN %* + +if "%OUTF%"=="" goto :EXIT + +call _parseLibs -vv -o "%OUTF%" %* + +:EXIT +popd +pause +exit /b + +:FINDFN +for %%i in (%*) do ( + if exist %%i set OUTF=%%~dpni%EXT%&goto :ENDFDF +) +:ENDFDF +exit /b diff --git a/win32/build-tcc.bat b/win32/build-tcc.bat index 5bc5585..772ed26 100644 --- a/win32/build-tcc.bat +++ b/win32/build-tcc.bat @@ -5,7 +5,7 @@ @set /p VERSION= < ..\VERSION echo>..\config.h #define TCC_VERSION "%VERSION%" -@if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64 +@rem @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64 @if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64 @set target=-DTCC_TARGET_PE -DTCC_TARGET_I386 @@ -58,3 +58,10 @@ tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o d :the_end del *.o + +:makedoc +echo>..\config.texi @set VERSION %VERSION% +if not exist doc md doc +makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi +if exist tcc-win32.txt move tcc-win32.txt doc\ +copy ..\tests\libtcc_test.c examples\ -- cgit v1.3.1 From fbc8810334e6a087bed6de4dd84635cb6037b4dc Mon Sep 17 00:00:00 2001 From: grischka Date: Mon, 16 Dec 2013 15:38:10 +0100 Subject: Fix "Add support for struct > 4B returned via registers" - avoid assumption "ret_align == register_size" which is false for non-arm targets - rename symbol "sret" to more descriptive "ret_nregs" This fixes commit dcec8673f21da86ae3dcf1ca3e9498127715b795 Also: - remove multiple definitions in win32/include/math.h --- i386-gen.c | 2 +- tccgen.c | 43 ++++++++++++++++++++++++++++--------------- win32/include/math.h | 2 ++ 3 files changed, 31 insertions(+), 16 deletions(-) (limited to 'win32') diff --git a/i386-gen.c b/i386-gen.c index eaab2b7..b26b844 100644 --- a/i386-gen.c +++ b/i386-gen.c @@ -392,7 +392,7 @@ ST_FUNC int gfunc_sret(CType *vt, CType *ret, int *ret_align) } else { ret->ref = NULL; ret->t = VT_INT; - return 0; + return 1; } #else *ret_align = 1; // Never have to re-align return values for x86 diff --git a/tccgen.c b/tccgen.c index 500e99e..bf208af 100644 --- a/tccgen.c +++ b/tccgen.c @@ -3927,7 +3927,7 @@ ST_FUNC void unary(void) } else if (tok == '(') { SValue ret; Sym *sa; - int nb_args, sret, ret_align; + int nb_args, ret_nregs, ret_align; /* function call */ if ((vtop->type.t & VT_BTYPE) != VT_FUNC) { @@ -3951,8 +3951,8 @@ ST_FUNC void unary(void) ret.r2 = VT_CONST; /* compute first implicit argument if a structure is returned */ if ((s->type.t & VT_BTYPE) == VT_STRUCT) { - sret = gfunc_sret(&s->type, &ret.type, &ret_align); - if (!sret) { + ret_nregs = gfunc_sret(&s->type, &ret.type, &ret_align); + if (!ret_nregs) { /* get some space for the returned structure */ size = type_size(&s->type, &align); loc = (loc - size) & -align; @@ -3965,11 +3965,11 @@ ST_FUNC void unary(void) nb_args++; } } else { - sret = 1; + ret_nregs = 1; ret.type = s->type; } - if (sret) { + if (ret_nregs) { /* return in register */ if (is_float(ret.type.t)) { ret.r = reg_fret(ret.type.t); @@ -4008,23 +4008,30 @@ ST_FUNC void unary(void) } else { vtop -= (nb_args + 1); } + /* return value */ - for (r = ret.r + sret + !sret; r-- > ret.r;) { + for (r = ret.r + ret_nregs + !ret_nregs; r-- > ret.r;) { vsetc(&ret.type, r, &ret.c); vtop->r2 = ret.r2; /* Loop only happens when r2 is VT_CONST */ } + /* handle packed struct return */ - if (((s->type.t & VT_BTYPE) == VT_STRUCT) && sret) { + if (((s->type.t & VT_BTYPE) == VT_STRUCT) && ret_nregs) { int addr, offset; size = type_size(&s->type, &align); loc = (loc - size) & -align; addr = loc; - for(offset = 0; offset < size; offset += ret_align) { + offset = 0; + for (;;) { vset(&ret.type, VT_LOCAL | VT_LVAL, addr + offset); vswap(); vstore(); vtop--; + if (--ret_nregs == 0) + break; + /* XXX: compatible with arm only: ret_align == register_size */ + offset += ret_align; } vset(&s->type, VT_LOCAL | VT_LVAL, addr); } @@ -4596,8 +4603,9 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, gen_assign_cast(&func_vt); if ((func_vt.t & VT_BTYPE) == VT_STRUCT) { CType type, ret_type; - int ret_align; - if (!gfunc_sret(&func_vt, &ret_type, &ret_align)) { + int ret_align, ret_nregs; + ret_nregs = gfunc_sret(&func_vt, &ret_type, &ret_align); + if (0 == ret_nregs) { /* if returning structure, must copy it to implicit first pointer arg location */ type = func_vt; @@ -4609,7 +4617,7 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, vstore(); } else { /* returning structure packed into registers */ - int r, size, addr, offset, align; + int r, size, addr, align; size = type_size(&func_vt,&align); if ((vtop->r != (VT_LOCAL | VT_LVAL) || (vtop->c.i & (ret_align-1))) && (align & (ret_align-1))) { @@ -4626,11 +4634,16 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, r = rc_fret(ret_type.t); else r = RC_IRET; - /* We assume that when a structure is returned in multiple - registers, their classes are consecutive values of the - suite s(n) = 2^n */ - for (offset = 0; offset < size; offset += ret_align, r<<=1) { + + for (;;) { gv(r); + if (--ret_nregs == 0) + break; + /* We assume that when a structure is returned in multiple + registers, their classes are consecutive values of the + suite s(n) = 2^n */ + r <<= 1; + /* XXX: compatible with arm only: ret_align == register_size */ vtop->c.i += ret_align; vtop->r = VT_LOCAL | VT_LVAL; } diff --git a/win32/include/math.h b/win32/include/math.h index 984a717..4fe64e7 100644 --- a/win32/include/math.h +++ b/win32/include/math.h @@ -666,6 +666,7 @@ extern "C" { extern long double __cdecl fmal (long double, long double, long double); +#if 0 // gr: duplicate, see below /* 7.12.14 */ /* * With these functions, comparisons involving quiet NaNs set the FP @@ -708,6 +709,7 @@ extern "C" { & 0x4500) == 0x4500) #endif +#endif //0 #endif /* __STDC_VERSION__ >= 199901L */ -- cgit v1.3.1 From d443644de360f68a84c05ab23f20f013b6e05b58 Mon Sep 17 00:00:00 2001 From: grischka Date: Mon, 6 Jan 2014 19:04:50 +0100 Subject: tccpe: cleanup "imports per ordinal" - tccpe.c: avoid conflict with imp_sym->st_value, cleanup - _parseLibs.bat, _tcc.bat: no instructions for usage, removed. from commit 642b6d0f50c6b6a842c9239a102fe34d5619e931 --- tccpe.c | 67 ++++++++++++++++++++++---------------------- win32/_parseLibs.bat | 79 ---------------------------------------------------- win32/_tcc.bat | 30 -------------------- 3 files changed, 33 insertions(+), 143 deletions(-) delete mode 100644 win32/_parseLibs.bat delete mode 100644 win32/_tcc.bat (limited to 'win32') diff --git a/tccpe.c b/tccpe.c index 62df865..ed7cb82 100644 --- a/tccpe.c +++ b/tccpe.c @@ -813,28 +813,24 @@ static void pe_build_imports(struct pe_info *pe) hdr->Name = v + rva_base; for (k = 0, n = p->sym_count; k <= n; ++k) { - int ordinal = 0; if (k < n) { int iat_index = p->symbols[k]->iat_index; int sym_index = p->symbols[k]->sym_index; ElfW(Sym) *imp_sym = (ElfW(Sym) *)pe->s1->dynsymtab_section->data + sym_index; ElfW(Sym) *org_sym = (ElfW(Sym) *)symtab_section->data + iat_index; const char *name = pe->s1->dynsymtab_section->link->data + imp_sym->st_name; + int ordinal; org_sym->st_value = thk_ptr; org_sym->st_shndx = pe->thunk->sh_num; - v = pe->thunk->data_offset + rva_base; - - /* ordinal or name */ - ordinal = imp_sym->st_value; /* from pe_load_def, temperary use */ - //if (ordinal) printf("ordinal: %d\n", ordinal); - if (!ordinal) { - section_ptr_add(pe->thunk, sizeof(WORD)); /* hint, not used */ - put_elf_str(pe->thunk, name); - } + + if (dllref) + v = 0, ordinal = imp_sym->st_value; /* ordinal from pe_load_def */ + else + ordinal = 0, v = imp_sym->st_value; /* address from tcc_add_symbol() */ + #ifdef TCC_IS_NATIVE if (pe->type == PE_RUN) { - v = imp_sym->st_value; if (dllref) { if ( !dllref->handle ) dllref->handle = LoadLibrary(dllref->name); @@ -842,13 +838,22 @@ static void pe_build_imports(struct pe_info *pe) } if (!v) tcc_error_noabort("can't build symbol '%s'", name); - } + } else #endif + if (ordinal) { + v = ordinal | (ADDR3264)1 << (sizeof(ADDR3264)*8 - 1); + } else { + v = pe->thunk->data_offset + rva_base; + section_ptr_add(pe->thunk, sizeof(WORD)); /* hint, not used */ + put_elf_str(pe->thunk, name); + } + } else { v = 0; /* last entry is zero */ } + *(ADDR3264*)(pe->thunk->data+thk_ptr) = - *(ADDR3264*)(pe->thunk->data+ent_ptr) = (ordinal && pe->type != PE_RUN)?(ADDR3264)1<<(sizeof(ADDR3264)*8-1)|ordinal:v; + *(ADDR3264*)(pe->thunk->data+ent_ptr) = v; thk_ptr += sizeof (ADDR3264); ent_ptr += sizeof (ADDR3264); } @@ -1593,12 +1598,11 @@ static char *get_line(char *line, int size, int fd) /* ------------------------------------------------------------- */ static int pe_load_def(TCCState *s1, int fd) { - int state = 0, ret = -1, dllindex = 0; - char line[400], dllname[80], *p; + int state = 0, ret = -1, dllindex = 0, ord; + char line[400], dllname[80], *p, *x; for (;;) { - int ord = 0; - char *x, *d, idxstr[8]; + p = get_line(line, sizeof line, fd); if (NULL == p) break; @@ -1621,24 +1625,19 @@ static int pe_load_def(TCCState *s1, int fd) case 2: dllindex = add_dllref(s1, dllname); ++state; - + /* fall through */ default: - /* get ordianl and will store in sym->st_value */ - d = NULL; - x = strchr(line, ' '); - if (x) x = strchr(line, '@'); - while (x != NULL) { - d =x; - x = strchr(x+1, '@'); - } - if (d) { - ord = atoi(d+1); - itoa(ord, idxstr, 10); - if (strcmp(idxstr, d+1) == 0) { - memset(d, 0, 1); - trimback(p, d); - } else - ord = 0; + /* get ordinal and will store in sym->st_value */ + ord = 0; + x = strchr(p, ' '); + if (x) { + *x = 0, x = strrchr(x + 1, '@'); + if (x) { + char *d; + ord = (int)strtol(x + 1, &d, 10); + if (*d) + ord = 0; + } } pe_putimport(s1, dllindex, p, ord); continue; diff --git a/win32/_parseLibs.bat b/win32/_parseLibs.bat deleted file mode 100644 index 19e8e64..0000000 --- a/win32/_parseLibs.bat +++ /dev/null @@ -1,79 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -pushd %~dp0 - -::Define as main parameters -set _Args_= -set _LIBs_= -set LIBi= - -set ARGSO=-IExt\include -LExt\lib %* - -::This is for the .def file also have a similar name .c file -::.a file will be larger than .def + .c -::*-uuid.c files are suitable to form libuuid.a -::w32api-3.17.2 -:GetRLib -for %%i in (%ARGSO%) do ( - set ARG=%%i - set OPT=!ARG:~0,2! - if "!OPT!"=="-l" ( - set LIB=!ARG:~2! - set LIBi= - if "!LIB!"=="uuid" ( - set LIBi= lib\*uid.c - ) else ( - if "!LIB!"=="vfw32" ( - set LIBi= lib\msvfw32.def lib\avifil32.def lib\avicap32.def - ) else ( - call :GetLibS - ) - ) - if "!LIBi!"=="" ( - set _Args_=!_Args_! %%i - ) else ( - set LIBi=!LIBi:%~dp0=! - set _LIBs_=!_LIBs_! !LIBi! - echo For lib !LIB! will use: - echo !LIBi! - echo. - ) - ) else ( - set _Args_=!_Args_! %%i - ) -) - -::GetRLib End -popd - -tcc.exe !_Args_! !_LIBs_! - -exit /b - -:::::::::: - -:GetLibS -for %%D in (-Llib %ARGSO%) do ( - set ARG_=%%D - set OPT_=!ARG_:~0,2! - set LIBD= - if "!OPT_!"=="-L" ( - set LIBD=!ARG_:~2! - if exist "!LIBD!" call :GetDLib - ) -) -set LIBD= -set OPT_= -set ARG_= -exit /b -::GetLibD End - -:GetDLib -pushd !LIBD! -for /f "usebackq delims=" %%I in (`"dir /b /s !LIB!.c !LIB!_*.c !LIB!.def !LIB!_*.def 2>nul"`) do ( - set LIBi=!LIBi! "%%I" -) -popd -exit /b -::GetDLib End diff --git a/win32/_tcc.bat b/win32/_tcc.bat deleted file mode 100644 index 65a7697..0000000 --- a/win32/_tcc.bat +++ /dev/null @@ -1,30 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -pushd %~dp0 - -path %~dp0;%path% - -set EXT=.exe -echo %*|findstr /R /C:"\<-c\>" >nul &&set EXT=.o -echo %*|findstr /R /C:"\<-shared\>" >nul &&set EXT=.dll - -::1st file found must be the main c file to get output file name -set OUTF= -call :FINDFN %* - -if "%OUTF%"=="" goto :EXIT - -call _parseLibs -vv -o "%OUTF%" %* - -:EXIT -popd -pause -exit /b - -:FINDFN -for %%i in (%*) do ( - if exist %%i set OUTF=%%~dpni%EXT%&goto :ENDFDF -) -:ENDFDF -exit /b -- cgit v1.3.1 From 2bd0daabbe1fc40e65e4a4631e68f5ca093ea1fb Mon Sep 17 00:00:00 2001 From: grischka Date: Mon, 6 Jan 2014 19:56:26 +0100 Subject: misc. fixes - tccgen: error out for cast to void, as in void foo(void) { return 1; } This avoids an assertion failure in x86_64-gen.c, also. also fix tests2/03_struct.c accordingly - Error: "memory full" - be more specific - Makefiles: remove circular dependencies, lookup tcctest.c from VPATH - tcc.h: cleanup lib, include, crt and libgcc search paths" avoid duplication or trailing slashes with no CONFIG_MULTIARCHDIR (as from 9382d6f1a0e2d0104a82ed805207d9e742c6b068) - tcc.h: remove ";{B}" from PE search path in ce5e12c2f950052d8109b6b7a56d900547705c08 James Lyon wrote: "... I'm not sure this is the right way to fix this problem." And the answer is: No, please. (copying libtcc1.a for tests instead) - win32/build_tcc.bat: do not move away a versioned file --- Makefile | 3 --- lib/Makefile | 3 --- libtcc.c | 4 ++-- tcc.h | 30 +++++++++++++++--------------- tccgen.c | 8 ++++---- tccpp.c | 4 ++-- tests/Makefile | 39 ++++++++++++++++++++------------------- tests/tests2/03_struct.c | 2 +- tests/tests2/Makefile | 3 --- win32/build-tcc.bat | 4 ++-- 10 files changed, 46 insertions(+), 54 deletions(-) (limited to 'win32') diff --git a/Makefile b/Makefile index 24a7c09..5052758 100644 --- a/Makefile +++ b/Makefile @@ -362,9 +362,6 @@ tar: tcc-doc.html rm -rf $(TCC-VERSION) git reset -Makefile: $(top_srcdir)/Makefile - cp $< $@ - .PHONY: all clean tar distclean install uninstall FORCE endif # ifeq ($(TOP),.) diff --git a/lib/Makefile b/lib/Makefile index a8a2b5d..394df67 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -111,6 +111,3 @@ $(DIR)/exists : clean : rm -rfv i386-win32 x86_64-win32 i386 x86_64 - -Makefile: $(top_srcdir)/lib/Makefile - cp $< $@ diff --git a/libtcc.c b/libtcc.c index df201ae..072b77f 100644 --- a/libtcc.c +++ b/libtcc.c @@ -214,7 +214,7 @@ PUB_FUNC void *tcc_malloc(unsigned long size) void *ptr; ptr = malloc(size); if (!ptr && size) - tcc_error("memory full"); + tcc_error("memory full (malloc)"); #ifdef MEM_DEBUG mem_cur_size += malloc_usable_size(ptr); if (mem_cur_size > mem_max_size) @@ -239,7 +239,7 @@ PUB_FUNC void *tcc_realloc(void *ptr, unsigned long size) #endif ptr1 = realloc(ptr, size); if (!ptr1 && size) - tcc_error("memory full"); + tcc_error("memory full (realloc)"); #ifdef MEM_DEBUG /* NOTE: count not correct if alloc error, but not critical */ mem_cur_size += malloc_usable_size(ptr1); diff --git a/tcc.h b/tcc.h index 21957e7..0933b01 100644 --- a/tcc.h +++ b/tcc.h @@ -169,13 +169,18 @@ #ifndef CONFIG_LDDIR # define CONFIG_LDDIR "lib" #endif -#ifndef CONFIG_MULTIARCHDIR -#define CONFIG_MULTIARCHDIR + +#ifdef CONFIG_MULTIARCHDIR +# define USE_MUADIR(s) s "/" CONFIG_MULTIARCHDIR +# define ALSO_MUADIR(s) s "/" CONFIG_MULTIARCHDIR ":" s +#else +# define USE_MUADIR(s) s +# define ALSO_MUADIR(s) s #endif /* path to find crt1.o, crti.o and crtn.o */ #ifndef CONFIG_TCC_CRTPREFIX -# define CONFIG_TCC_CRTPREFIX CONFIG_SYSROOT "/usr/" CONFIG_LDDIR "/" CONFIG_MULTIARCHDIR +# define CONFIG_TCC_CRTPREFIX USE_MUADIR(CONFIG_SYSROOT "/usr/" CONFIG_LDDIR) #endif /* Below: {B} is substituted by CONFIG_TCCDIR (rsp. -B option) */ @@ -186,10 +191,8 @@ # define CONFIG_TCC_SYSINCLUDEPATHS "{B}/include;{B}/include/winapi" # else # define CONFIG_TCC_SYSINCLUDEPATHS \ - CONFIG_SYSROOT "/usr/local/include/" CONFIG_MULTIARCHDIR \ - ":" CONFIG_SYSROOT "/usr/local/include" \ - ":" CONFIG_SYSROOT "/usr/include/" CONFIG_MULTIARCHDIR \ - ":" CONFIG_SYSROOT "/usr/include" \ + ALSO_MUADIR(CONFIG_SYSROOT "/usr/local/include") \ + ":" ALSO_MUADIR(CONFIG_SYSROOT "/usr/include") \ ":" "{B}/include" # endif #endif @@ -197,15 +200,12 @@ /* library search paths */ #ifndef CONFIG_TCC_LIBPATHS # ifdef TCC_TARGET_PE -# define CONFIG_TCC_LIBPATHS "{B}/lib;{B}" +# define CONFIG_TCC_LIBPATHS "{B}/lib" # else # define CONFIG_TCC_LIBPATHS \ - CONFIG_SYSROOT "/usr/" CONFIG_LDDIR "/" CONFIG_MULTIARCHDIR \ - ":" CONFIG_SYSROOT "/usr/" CONFIG_LDDIR \ - ":" CONFIG_SYSROOT "/" CONFIG_LDDIR "/" CONFIG_MULTIARCHDIR \ - ":" CONFIG_SYSROOT "/" CONFIG_LDDIR \ - ":" CONFIG_SYSROOT "/usr/local/" CONFIG_LDDIR "/" CONFIG_MULTIARCHDIR \ - ":" CONFIG_SYSROOT "/usr/local/" CONFIG_LDDIR + ALSO_MUADIR(CONFIG_SYSROOT "/usr/" CONFIG_LDDIR) \ + ":" ALSO_MUADIR(CONFIG_SYSROOT "/" CONFIG_LDDIR) \ + ":" ALSO_MUADIR(CONFIG_SYSROOT "/usr/local/" CONFIG_LDDIR) # endif #endif @@ -237,7 +237,7 @@ #endif /* library to use with CONFIG_USE_LIBGCC instead of libtcc1.a */ -#define TCC_LIBGCC CONFIG_SYSROOT "/" CONFIG_LDDIR "/" CONFIG_MULTIARCHDIR "/libgcc_s.so.1" +#define TCC_LIBGCC USE_MUADIR(CONFIG_SYSROOT "/" CONFIG_LDDIR) "/libgcc_s.so.1" /* -------------------------------------------- */ /* include the target specific definitions */ diff --git a/tccgen.c b/tccgen.c index 8355aae..f23cd07 100644 --- a/tccgen.c +++ b/tccgen.c @@ -309,7 +309,7 @@ static void vsetc(CType *type, int r, CValue *vc) int v; if (vtop >= vstack + (VSTACK_SIZE - 1)) - tcc_error("memory full"); + tcc_error("memory full (vstack)"); /* cannot let cpu flags if other instruction are generated. Also avoid leaving VT_JMP anywhere except on the top of the stack because it would complicate the code generator. */ @@ -483,7 +483,7 @@ ST_FUNC void vswap(void) ST_FUNC void vpushv(SValue *v) { if (vtop >= vstack + (VSTACK_SIZE - 1)) - tcc_error("memory full"); + tcc_error("memory full (vstack)"); vtop++; *vtop = *v; } @@ -2348,8 +2348,8 @@ static void gen_assign_cast(CType *dt) st = &vtop->type; /* source type */ dbt = dt->t & VT_BTYPE; sbt = st->t & VT_BTYPE; - if (sbt == VT_VOID) - tcc_error("Cannot assign void value"); + if (sbt == VT_VOID || dbt == VT_VOID) + tcc_error("cannot cast from/to void"); if (dt->t & VT_CONSTANT) tcc_warning("assignment of read-only location"); switch(dbt) { diff --git a/tccpp.c b/tccpp.c index aeaf6be..e1ccded 100644 --- a/tccpp.c +++ b/tccpp.c @@ -197,7 +197,7 @@ static TokenSym *tok_alloc_new(TokenSym **pts, const char *str, int len) int i; if (tok_ident >= SYM_FIRST_ANOM) - tcc_error("memory full"); + tcc_error("memory full (symbols)"); /* expand token table if needed */ i = tok_ident - TOK_IDENT; @@ -1528,7 +1528,7 @@ include_done: c = (define_find(tok) != 0) ^ c; do_if: if (s1->ifdef_stack_ptr >= s1->ifdef_stack + IFDEF_STACK_SIZE) - tcc_error("memory full"); + tcc_error("memory full (ifdef)"); *s1->ifdef_stack_ptr++ = c; goto test_skip; case TOK_ELSE: diff --git a/tests/Makefile b/tests/Makefile index 08dfa42..b958a48 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -27,7 +27,7 @@ ifneq ($(ARCH),i386) TESTS := $(filter-out btest,$(TESTS)) endif ifdef CONFIG_WIN32 - TESTS := $(filter-out test3,$(TESTS)) + TESTS := w32-prep $(filter-out test3,$(TESTS)) endif ifeq ($(TARGETOS),Darwin) TESTS := $(filter-out hello-exe test3 btest,$(TESTS)) @@ -84,6 +84,9 @@ moretests: @echo ------------ $@ ------------ $(MAKE) -C tests2 +w32-prep: + cp ../libtcc1.a ../lib + # test.ref - generate using gcc # copy only tcclib.h so GCC's stddef and stdarg will be used test.ref: tcctest.c @@ -91,41 +94,41 @@ test.ref: tcctest.c ./tcctest.gcc > $@ # auto test -test1: test.ref +test1: tcctest.c test.ref @echo ------------ $@ ------------ - $(TCC) -run $(SRCDIR)/tcctest.c > test.out1 + $(TCC) -run $< > test.out1 @if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi # iterated test2 (compile tcc then compile tcctest.c !) -test2: test.ref +test2: tcctest.c test.ref @echo ------------ $@ ------------ - $(TCC) $(RUN_TCC) $(RUN_TCC) -run $(SRCDIR)/tcctest.c > test.out2 + $(TCC) $(RUN_TCC) $(RUN_TCC) -run $< > test.out2 @if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi # iterated test3 (compile tcc then compile tcc then compile tcctest.c !) -test3: test.ref +test3: tcctest.c test.ref @echo ------------ $@ ------------ - $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run $(SRCDIR)/tcctest.c > test.out3 + $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run $< > test.out3 @if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi # binary output test -test4: test.ref +test4: tcctest.c test.ref @echo ------------ $@ ------------ # object + link output - $(TCC) -c -o tcctest3.o $(SRCDIR)/tcctest.c + $(TCC) -c -o tcctest3.o $< $(TCC) -o tcctest3 tcctest3.o ./tcctest3 > test3.out @if diff -u test.ref test3.out ; then echo "Object Auto Test OK"; fi # dynamic output - $(TCC) -o tcctest1 $(SRCDIR)/tcctest.c + $(TCC) -o tcctest1 $< ./tcctest1 > test1.out @if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi # dynamic output + bound check - $(TCC) -b -o tcctest4 $(SRCDIR)/tcctest.c + $(TCC) -b -o tcctest4 $< ./tcctest4 > test4.out @if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi # static output - $(TCC) -static -o tcctest2 $(SRCDIR)/tcctest.c + $(TCC) -static -o tcctest2 $< ./tcctest2 > test2.out @if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi @@ -161,9 +164,9 @@ speedtest: ex2 ex3 time ./ex3 35 time $(TCC) -run $(top_srcdir)/examples/ex3.c 35 -weaktest: test.ref - $(TCC) -c tcctest.c -o weaktest.tcc.o $(CPPFLAGS) $(CFLAGS) - $(CC) -c tcctest.c -o weaktest.gcc.o -I. $(CPPFLAGS) -w $(CFLAGS) +weaktest: tcctest.c test.ref + $(TCC) -c $< -o weaktest.tcc.o $(CPPFLAGS) $(CFLAGS) + $(CC) -c $< -o weaktest.gcc.o -I. $(CPPFLAGS) -w $(CFLAGS) objdump -t weaktest.tcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.tcc.o.txt objdump -t weaktest.gcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.gcc.o.txt diff weaktest.gcc.o.txt weaktest.tcc.o.txt && echo "Weak Auto Test OK" @@ -220,7 +223,5 @@ cache: tcc_g clean: $(MAKE) -C tests2 $@ rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc *.exe \ - hello libtcc_test tcctest[1234] ex? tcc_g tcclib.h - -Makefile: $(SRCDIR)/Makefile - cp $< $@ + hello libtcc_test tcctest[1234] ex? tcc_g tcclib.h \ + ../lib/libtcc1.a diff --git a/tests/tests2/03_struct.c b/tests/tests2/03_struct.c index df0d3e7..c5d48c5 100644 --- a/tests/tests2/03_struct.c +++ b/tests/tests2/03_struct.c @@ -6,7 +6,7 @@ struct fred int natasha; }; -void main() +int main() { struct fred bloggs; diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile index 369ed47..51dc38d 100644 --- a/tests/tests2/Makefile +++ b/tests/tests2/Makefile @@ -96,6 +96,3 @@ all test: $(TESTS) clean: rm -vf fred.txt *.output - -Makefile: $(top_srcdir)/tests/tests2/Makefile - cp $< $@ diff --git a/win32/build-tcc.bat b/win32/build-tcc.bat index 772ed26..bd897c4 100644 --- a/win32/build-tcc.bat +++ b/win32/build-tcc.bat @@ -63,5 +63,5 @@ del *.o echo>..\config.texi @set VERSION %VERSION% if not exist doc md doc makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi -if exist tcc-win32.txt move tcc-win32.txt doc\ -copy ..\tests\libtcc_test.c examples\ +copy tcc-win32.txt doc +copy ..\tests\libtcc_test.c examples -- cgit v1.3.1 From 48ad93983f292b0eab62b8d8cce2abcb50e4701d Mon Sep 17 00:00:00 2001 From: Austin English Date: Mon, 20 Jan 2014 02:23:34 -0800 Subject: workaround a wine cmd bug in build-tcc.bat --- win32/build-tcc.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'win32') diff --git a/win32/build-tcc.bat b/win32/build-tcc.bat index bd897c4..f5c414a 100644 --- a/win32/build-tcc.bat +++ b/win32/build-tcc.bat @@ -25,7 +25,7 @@ echo>..\config.h #define TCC_VERSION "%VERSION%" %CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe :libtcc -if not exist libtcc\nul mkdir libtcc +if not exist libtcc mkdir libtcc copy ..\libtcc.h libtcc\libtcc.h %CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a tiny_impdef libtcc.dll -o libtcc/libtcc.def -- cgit v1.3.1 From bba1c381f4f9862f0c9ce4afc7705ac9a624842f Mon Sep 17 00:00:00 2001 From: minux Date: Fri, 11 Apr 2014 23:23:05 -0400 Subject: tiny_impdef: remove artificial length restriction. --- win32/tools/tiny_impdef.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'win32') diff --git a/win32/tools/tiny_impdef.c b/win32/tools/tiny_impdef.c index 1739549..d12c502 100644 --- a/win32/tools/tiny_impdef.c +++ b/win32/tools/tiny_impdef.c @@ -226,7 +226,7 @@ found: for (l = 0;;) { if (n+1 >= n0) p = tcc_realloc(p, n0 = n0 ? n0 * 2 : 256); - if (!read_mem(fd, ptr - ref + l, p + n, 1) || ++l >= 80) { + if (!read_mem(fd, ptr - ref + l++, p + n, 1)) { tcc_free(p), p = NULL; goto the_end; } -- cgit v1.3.1 From 5f7cdd29b6b0f70ca9a4c4a17b3e48009ed4b603 Mon Sep 17 00:00:00 2001 From: minux Date: Sat, 12 Apr 2014 00:09:57 -0400 Subject: win32/include/process.h: update prototypes to match mingw. This eliminates an argument type mismatch warning during tcc self-compilation on windows. --- win32/include/process.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'win32') diff --git a/win32/include/process.h b/win32/include/process.h index f679442..dadaf2b 100644 --- a/win32/include/process.h +++ b/win32/include/process.h @@ -153,20 +153,20 @@ extern "C" { stupid warnings, define them in POSIX way. This is save, because those methods do not return in success case, so that the return value is not really dependent to its scalar width. */ - int __cdecl execv(const char *_Filename,char *const _ArgList[]); - int __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]); - int __cdecl execvp(const char *_Filename,char *const _ArgList[]); - int __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]); + int __cdecl execv(const char *_Filename,const char *const _ArgList[]); + int __cdecl execve(const char *_Filename,const char *const _ArgList[],const char *const _Env[]); + int __cdecl execvp(const char *_Filename,const char *const _ArgList[]); + int __cdecl execvpe(const char *_Filename,const char *const _ArgList[],const char *const _Env[]); #else - intptr_t __cdecl execv(const char *_Filename,char *const _ArgList[]); - intptr_t __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]); - intptr_t __cdecl execvp(const char *_Filename,char *const _ArgList[]); - intptr_t __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]); + intptr_t __cdecl execv(const char *_Filename,const char *const _ArgList[]); + intptr_t __cdecl execve(const char *_Filename,const char *const _ArgList[],const char *const _Env[]); + intptr_t __cdecl execvp(const char *_Filename,const char *const _ArgList[]); + intptr_t __cdecl execvpe(const char *_Filename,const char *const _ArgList[],const char *const _Env[]); #endif - intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]); - intptr_t __cdecl spawnve(int,const char *_Filename,char *const _ArgList[],char *const _Env[]); - intptr_t __cdecl spawnvp(int,const char *_Filename,char *const _ArgList[]); - intptr_t __cdecl spawnvpe(int,const char *_Filename,char *const _ArgList[],char *const _Env[]); + intptr_t __cdecl spawnv(int,const char *_Filename,const char *const _ArgList[]); + intptr_t __cdecl spawnve(int,const char *_Filename,const char *const _ArgList[],const char *const _Env[]); + intptr_t __cdecl spawnvp(int,const char *_Filename,const char *const _ArgList[]); + intptr_t __cdecl spawnvpe(int,const char *_Filename,const char *const _ArgList[],char *const _Env[]); #endif #ifdef __cplusplus -- cgit v1.3.1