* device/lib/Makefile.in: remove abspath for PORTDIR, introduced in
[fw/sdcc] / support / librarian / sdcclib.c
index 7b8c1f061e5e7c70809d4b48bb842cde6ecdbec5..8537cba39ddcd041fdec917d624efb5548eab019 100644 (file)
@@ -48,19 +48,6 @@ int NumRelFiles=0;
 #define EQ(A,B) !strcmp((A),(B))
 #define NEQ(A,B) strcmp((A),(B))
 
-#if 1
-#define fgets(S, SIZE, STREAM)  do {                    \
-  char *__s4567 = S;                                    \
-  char *__res4567 = fgets(__s4567, SIZE, STREAM);       \
-  assert(__s4567 == __res4567);                         \
-} while (0)
-
-#define system(CMD)             do {                    \
-  int __res4568 = system(CMD);                          \
-  assert(-1 != __res4568);                              \
-} while (0)
-#endif
-
 int action=OPT_NONE;
 FILE *lib, *newlib, *rel, *adb, *libindex;
 char FLine[MAXLINE+1];
@@ -315,7 +302,7 @@ void AddRel(char * RelName)
                         fprintf(libindex, "<MODULE>\n%s %ld\n", FLine, newlibpos);
                         state++;
                     }
-                }                
+                }
             break;
             case 1:
                 fprintf(newlib, "%s\n", FLine);
@@ -363,7 +350,7 @@ void AddRel(char * RelName)
         fclose(rel);
         fprintf(libindex, "</MODULE>\n");
         fprintf(newlib, "</REL>\n<ADB>\n");
-    
+
         adb=fopen(AdbName, "r");
         if(adb!=NULL)
         {
@@ -480,7 +467,7 @@ void ExtractRel(char * RelName)
                     fgets(FLine, MAXLINE, lib);
                     CleanLine(FLine);
                     if(EQ(FLine, ModName)) state=1;
-                }                
+                }
             break;
             case 1:
                 if(EQ(FLine, "<REL>")) state=2;
@@ -499,10 +486,10 @@ void ExtractRel(char * RelName)
                     state=5;
                 else
                     fprintf(adb, "%s\n", FLine);
-            break; 
+            break;
         }
     }
-    
+
     fclose(rel);
     fclose(lib);
     fclose(adb);
@@ -524,10 +511,10 @@ void DumpSymbols(void)
     CleanLine(FLine);
     if(NEQ(FLine, "<SDCCLIB>"))
     {
-        printf("ERROR: File '%s' was not created with '%s'\n", LibName, ProgName); 
+        printf("ERROR: File '%s' was not created with '%s'\n", LibName, ProgName);
         return;
     }
-    
+
     while(!feof(lib))
     {
         if(state==3) break;
@@ -572,14 +559,14 @@ void DumpSymbols(void)
             break;
         }
     }
-    
+
     fclose(lib);
 }
 
 int fileexist(char * fname)
 {
     FILE * fp;
-    
+
     fp=fopen(fname, "r");
     if(fp==NULL) return 0;
     fclose(fp);
@@ -673,7 +660,7 @@ int main(int argc, char **argv)
             for(j=0; j<NumRelFiles; j++) free(RelName[j]);
             free(RelName);
         break;
-        
+
         case OPT_ADD_LIST:
             AddList();
         break;
@@ -684,7 +671,7 @@ int main(int argc, char **argv)
             for(j=0; j<NumRelFiles; j++) free(RelName[j]);
             free(RelName);
         break;
-        
+
         case OPT_DUMP_SYM:
         case OPT_DUMP_MOD:
             DumpSymbols();