Revert "Win: Enable use "*.def + *.c" files as library instead of *.a by "-l" option"
authorThomas Coudray <amanone@gmail.com>
Fri, 20 Jun 2014 12:26:29 +0000 (20 13:26 +0100)
committerThomas Coudray <amanone@gmail.com>
Fri, 20 Jun 2014 12:26:29 +0000 (20 13:26 +0100)
libtcc.c

index 070c6f3..d761582 100644 (file)
--- a/libtcc.c
+++ b/libtcc.c
@@ -1300,7 +1300,7 @@ ST_FUNC int tcc_add_crt(TCCState *s, const char *filename)
 LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname)
 {
 #ifdef TCC_TARGET_PE
-    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 };
+    const char *libs[] = { "%s/%s.def", "%s/lib%s.def", "%s/%s.dll", "%s/lib%s.dll", "%s/lib%s.a", NULL };
     const char **pp = s->static_link ? libs + 4 : libs;
 #else
     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)
 #endif
     while (*pp) {
         if (0 == tcc_add_library_internal(s, *pp,
-            libraryname, 0, s->library_paths, s->nb_library_paths)) {
-#ifdef TCC_TARGET_PE
-            /* extra search for *.c file together with *.def file */
-            if (pp < libs + 2)
-                tcc_add_library_internal(s, *(libs + 5), libraryname, 0,
-                    s->library_paths, s->nb_library_paths);
-#endif
+            libraryname, 0, s->library_paths, s->nb_library_paths))
             return 0;
-        }
         ++pp;
     }
     return -1;