History

tccpe: with -l try also with "lib" prefix

-lfoo searches: foo.def, libfoo.def, foo.dll, libfoo.dll

grischka committed 16 years ago

Commit 3020a471 parent 94bf4d21 file · +11 −8Browse files

Unified · Split

tccpe.c+11−8
@@ -1611,15 +1611,18 @@ PUB_FN int pe_load_file(struct TCCState *s1, const char *filename, int fd) · 1610 unmodified lines
16111611 return ret;
16121612 }
16131613
1614−int pe_add_dll(struct TCCState *s, const char *libraryname)
1614+int pe_add_dll(struct TCCState *s, const char *libname)
16151615 {
1616− char buf[MAX_PATH];
1617− snprintf(buf, sizeof(buf), "%s.def", libraryname);
1618− if (tcc_add_dll(s, buf, 0) == 0)
1619− return 0;
1620− snprintf(buf, sizeof(buf), "%s.dll", libraryname);
1621− if (tcc_add_dll(s, buf, 0) == 0)
1622− return 0;
1616+ static const char *pat[] = {
1617+ "%s.def", "lib%s.def", "%s.dll", "lib%s.dll", NULL
1618+ };
1619+ const char **p = pat;
1620+ do {
1621+ char buf[MAX_PATH];
1622+ snprintf(buf, sizeof(buf), *p, libname);
1623+ if (tcc_add_dll(s, buf, 0) == 0)
1624+ return 0;
1625+ } while (*++p);
16231626 return -1;
16241627 }
16251628

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t