* device/lib/Makefile.in: remove abspath for PORTDIR, introduced in
[fw/sdcc] / support / librarian / sdcclib.c
index 9367f8f32b462ad06ac9070a6626cee3bdb55873..8537cba39ddcd041fdec917d624efb5548eab019 100644 (file)
@@ -48,24 +48,6 @@ int NumRelFiles=0;
 #define EQ(A,B) !strcmp((A),(B))
 #define NEQ(A,B) strcmp((A),(B))
 
-#if 1
-#include <assert.h>
-#define __assert(COND)  do { assert(COND); } while (0)
-#else
-#define __assert(COND)  do { (void)(COND); } while (0)
-#endif
-
-#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)
-
 int action=OPT_NONE;
 FILE *lib, *newlib, *rel, *adb, *libindex;
 char FLine[MAXLINE+1];
@@ -320,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);
@@ -368,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)
         {
@@ -485,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;
@@ -504,10 +486,10 @@ void ExtractRel(char * RelName)
                     state=5;
                 else
                     fprintf(adb, "%s\n", FLine);
-            break; 
+            break;
         }
     }
-    
+
     fclose(rel);
     fclose(lib);
     fclose(adb);
@@ -529,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;
@@ -577,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);
@@ -678,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;
@@ -689,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();