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:
grischka 2019-09-12 17:45:18 +02:00
parent d746e32349
commit 53d815b8a0
2 changed files with 3 additions and 3 deletions

View File

@ -3569,7 +3569,7 @@ again:
if (ds <= ss)
goto done;
/* 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);
goto done; /* no 64bit envolved */
}

View File

@ -825,7 +825,7 @@ static void pe_build_imports(struct pe_info *pe)
dllindex = p->dll_index;
if (dllindex)
name = (dllref = pe->s1->loaded_dlls[dllindex-1])->name;
name = tcc_basename((dllref = pe->s1->loaded_dlls[dllindex-1])->name);
else
name = "", dllref = NULL;
@ -1763,7 +1763,7 @@ static int pe_load_dll(TCCState *s1, const char *filename)
if (ret) {
return -1;
} else if (p) {
index = add_dllref(s1, tcc_basename(filename));
index = add_dllref(s1, filename);
for (q = p; *q; q += 1 + strlen(q))
pe_putimport(s1, index, q, 0);
tcc_free(p);