Tagging 2.2.2-pre1
[fw/sdcc] / src / SDCCglue.c
index 1adc235fa1d554e26505b000f9ae0870c0a9c4bf..686b67bea984544f07544f47a5efa2dbc0f57873 100644 (file)
 #include "asm.h"
 #include <time.h>
 
+#ifndef __BORLANDC__
+// This is a bit messy because we define link ourself
+#define link NoLiNk
+#include <unistd.h>
+#undef link
+#else
+// No unistd.h in Borland C++
+#endif
+
 symbol *interrupts[256];
-/*extern char *aopLiteral (value *, int);*//* drdani Jan 30 2000 */
+
 void printIval (symbol *, link *, initList *, FILE *);
-extern int noAlloc;
 set *publics = NULL;           /* public variables */
 set *externs = NULL;           /* Varibles that are declared as extern */
 
 /* TODO: this should be configurable (DS803C90 uses more than 6) */
 int maxInterrupts = 6;
 int allocInfo = 1;
-extern int maxRegBank ;
 symbol *mainf;
 extern char *VersionString;
-extern FILE *codeOutFile;
 set *tmpfileSet = NULL; /* set of tmp file created by the compiler */
 set *tmpfileNameSet = NULL; /* All are unlinked at close. */
 
@@ -225,7 +231,7 @@ static void emitRegularMap (memmap * map, bool addPublics, bool arFlag)
            tfprintf(map->oFile, "\t!ds\n", (unsigned int)getSize (sym->type) & 0xffff);
        }
        
-       /* if it has a initial value then do it only if
+       /* if it has an initial value then do it only if
           it is a global variable */
        if (sym->ival && sym->level == 0) {
            ast *ival = NULL;
@@ -233,7 +239,7 @@ static void emitRegularMap (memmap * map, bool addPublics, bool arFlag)
            if (IS_AGGREGATE (sym->type))
                ival = initAggregates (sym, sym->ival, NULL);
            else
-               ival = newNode ('=', newAst (EX_VALUE, symbolVal (sym)),
+               ival = newNode ('=', newAst_VALUE(symbolVal (sym)),
                                decorateType (resolveSymbols (list2expr (sym->ival))));
            codeOutFile = statsg->oFile;
            allocInfo = 0;