tccpe: with -l try also with "lib" prefix
-lfoo searches: foo.def, libfoo.def, foo.dll, libfoo.dll
This commit is contained in:
parent
94bf4d2c22
commit
3020a4765d
1 changed files with 11 additions and 8 deletions
19
tccpe.c
19
tccpe.c
|
@ -1611,15 +1611,18 @@ PUB_FN int pe_load_file(struct TCCState *s1, const char *filename, int fd)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pe_add_dll(struct TCCState *s, const char *libraryname)
|
int pe_add_dll(struct TCCState *s, const char *libname)
|
||||||
{
|
{
|
||||||
char buf[MAX_PATH];
|
static const char *pat[] = {
|
||||||
snprintf(buf, sizeof(buf), "%s.def", libraryname);
|
"%s.def", "lib%s.def", "%s.dll", "lib%s.dll", NULL
|
||||||
if (tcc_add_dll(s, buf, 0) == 0)
|
};
|
||||||
return 0;
|
const char **p = pat;
|
||||||
snprintf(buf, sizeof(buf), "%s.dll", libraryname);
|
do {
|
||||||
if (tcc_add_dll(s, buf, 0) == 0)
|
char buf[MAX_PATH];
|
||||||
return 0;
|
snprintf(buf, sizeof(buf), *p, libname);
|
||||||
|
if (tcc_add_dll(s, buf, 0) == 0)
|
||||||
|
return 0;
|
||||||
|
} while (*++p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue