win32/tccpe: use full dll-path with -run
This allows for example this scenario: - A dll to be linked with is specified in file.c, where file.c and the dll exist in the same directory: #pragma comment(lib, "txml") #pragma comment(option, "-L{f}") - tcc is called to run file.c from other, varying directories: $ tcc -run some/dir/file.c <args...> Note that tcc replaces {f} by the currently compiled file's directory ('some/dir' in this example). Also: - tccgen.c: fix last commit for gen_cast.
This commit is contained in:
parent
d746e32349
commit
53d815b8a0
2 changed files with 3 additions and 3 deletions
2
tccgen.c
2
tccgen.c
|
@ -3569,7 +3569,7 @@ again:
|
||||||
if (ds <= ss)
|
if (ds <= ss)
|
||||||
goto done;
|
goto done;
|
||||||
/* ss <= 4 here */
|
/* ss <= 4 here */
|
||||||
if (ds <= 4 && dbt != (VT_SHORT | VT_UNSIGNED) && sbt != VT_BYTE) {
|
if (ds <= 4 && !(dbt == (VT_SHORT | VT_UNSIGNED) && sbt == VT_BYTE)) {
|
||||||
gv(RC_INT);
|
gv(RC_INT);
|
||||||
goto done; /* no 64bit envolved */
|
goto done; /* no 64bit envolved */
|
||||||
}
|
}
|
||||||
|
|
4
tccpe.c
4
tccpe.c
|
@ -825,7 +825,7 @@ static void pe_build_imports(struct pe_info *pe)
|
||||||
|
|
||||||
dllindex = p->dll_index;
|
dllindex = p->dll_index;
|
||||||
if (dllindex)
|
if (dllindex)
|
||||||
name = (dllref = pe->s1->loaded_dlls[dllindex-1])->name;
|
name = tcc_basename((dllref = pe->s1->loaded_dlls[dllindex-1])->name);
|
||||||
else
|
else
|
||||||
name = "", dllref = NULL;
|
name = "", dllref = NULL;
|
||||||
|
|
||||||
|
@ -1763,7 +1763,7 @@ static int pe_load_dll(TCCState *s1, const char *filename)
|
||||||
if (ret) {
|
if (ret) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if (p) {
|
} else if (p) {
|
||||||
index = add_dllref(s1, tcc_basename(filename));
|
index = add_dllref(s1, filename);
|
||||||
for (q = p; *q; q += 1 + strlen(q))
|
for (q = p; *q; q += 1 + strlen(q))
|
||||||
pe_putimport(s1, index, q, 0);
|
pe_putimport(s1, index, q, 0);
|
||||||
tcc_free(p);
|
tcc_free(p);
|
||||||
|
|
Loading…
Reference in a new issue