This reverts commit 7a3f6d49415fd5f1fa99d25aba40c7884d5774a4.
Unified · Split
| @@ -1300,7 +1300,7 @@ ST_FUNC int tcc_add_crt(TCCState *s, const char *filename) · 1299 unmodified lines | |||
| 1300 | LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname) | 1300 | LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname) |
| 1301 | { | 1301 | { |
| 1302 | #ifdef TCC_TARGET_PE | 1302 | #ifdef TCC_TARGET_PE |
| 1303 | const char *libs[] = { "%s/%s.def", "%s/lib%s.def", "%s/%s.dll", "%s/lib%s.dll", "%s/lib%s.a", "%s/%s.c", NULL }; | 1303 | const char *libs[] = { "%s/%s.def", "%s/lib%s.def", "%s/%s.dll", "%s/lib%s.dll", "%s/lib%s.a", NULL }; |
| 1304 | const char **pp = s->static_link ? libs + 4 : libs; | 1304 | const char **pp = s->static_link ? libs + 4 : libs; |
| 1305 | #else | 1305 | #else |
| 1306 | const char *libs[] = { "%s/lib%s.so", "%s/lib%s.a", NULL }; | 1306 | const char *libs[] = { "%s/lib%s.so", "%s/lib%s.a", NULL }; |
| @@ -1308,15 +1308,8 @@ LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname) · 1 unmodified line | |||
| 1308 | #endif | 1308 | #endif |
| 1309 | while (*pp) { | 1309 | while (*pp) { |
| 1310 | if (0 == tcc_add_library_internal(s, *pp, | 1310 | if (0 == tcc_add_library_internal(s, *pp, |
| 1311 | libraryname, 0, s->library_paths, s->nb_library_paths)) { | 1311 | libraryname, 0, s->library_paths, s->nb_library_paths)) |
| 1312 | #ifdef TCC_TARGET_PE | ||
| 1313 | /* extra search for *.c file together with *.def file */ | ||
| 1314 | if (pp < libs + 2) | ||
| 1315 | tcc_add_library_internal(s, *(libs + 5), libraryname, 0, | ||
| 1316 | s->library_paths, s->nb_library_paths); | ||
| 1317 | #endif | ||
| 1318 | return 0; | 1312 | return 0; |
| 1319 | } | ||
| 1320 | ++pp; | 1313 | ++pp; |
| 1321 | } | 1314 | } |
| 1322 | return -1; | 1315 | return -1; |