From 9f8c951cd8a2b786910e1077b24b2237c654546f Mon Sep 17 00:00:00 2001 From: borutr Date: Sun, 30 Mar 2003 15:35:24 +0000 Subject: [PATCH] included "SDCCset.h", added declaration of setParseWithComma() git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2436 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCglobl.h | 6 ++++++ src/SDCCglue.c | 31 ++++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/SDCCglobl.h b/src/SDCCglobl.h index 947156f9..df1c7e5a 100644 --- a/src/SDCCglobl.h +++ b/src/SDCCglobl.h @@ -1,12 +1,17 @@ /* SDCCglobl.h - global macros etc required by all files */ + #ifndef SDCCGLOBL_H #define SDCCGLOBL_H + #include #include #include #include #include +#include "SDCCset.h" + + /* * Define host port dependant constants etc. */ @@ -294,6 +299,7 @@ extern int nlibFiles; extern char *libPaths[128]; extern int nlibPaths; +void setParseWithComma (set **, char *); void parseWithComma (char **, char *); /** Creates a temporary file a'la tmpfile which avoids the bugs diff --git a/src/SDCCglue.c b/src/SDCCglue.c index 5e1d084d..206d1d2b 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -45,7 +45,6 @@ set *externs = NULL; /* Varibles that are declared as extern */ unsigned maxInterrupts = 6; int allocInfo = 1; symbol *mainf; -extern char *VersionString; set *pipeSet = NULL; /* set of pipes */ set *tmpfileSet = NULL; /* set of tmp file created by the compiler */ set *tmpfileNameSet = NULL; /* All are unlinked at close. */ @@ -1331,7 +1330,7 @@ initialComments (FILE * afile) time_t t; time (&t); fprintf (afile, "%s", iComments1); - fprintf (afile, "; Version %s %s\n", VersionString, asctime (localtime (&t))); + fprintf (afile, "; Version " SDCC_VERSION_STR " %s\n", asctime (localtime (&t))); fprintf (afile, "%s", iComments2); } @@ -1468,6 +1467,30 @@ emitOverlay (FILE * afile) } } + +/*-----------------------------------------------------------------*/ +/* spacesToUnderscores - replace spaces with underscores */ +/*-----------------------------------------------------------------*/ +static char * +spacesToUnderscores (char *dest, const char *src, size_t len) +{ + int i; + char *p; + + assert(dest != NULL); + assert(src != NULL); + assert(len > 0); + + --len; + for (p = dest, i = 0; *src != '\0' && i < len; ++src, ++i) { + *p++ = isspace(*src) ? '_' : *src; + } + *p = '\0'; + + return dest; +} + + /*-----------------------------------------------------------------*/ /* glue - the final glue that hold the whole thing together */ /*-----------------------------------------------------------------*/ @@ -1477,6 +1500,7 @@ glue (void) FILE *vFile; FILE *asmFile; FILE *ovrFile = tempfile (); + char moduleBuf[PATH_MAX]; addSetHead (&tmpfileSet, ovrFile); /* print the global struct definitions */ @@ -1524,7 +1548,8 @@ glue (void) initialComments (asmFile); /* print module name */ - tfprintf (asmFile, "\t!module\n", moduleName); + tfprintf (asmFile, "\t!module\n", + spacesToUnderscores (moduleBuf, moduleName, sizeof moduleBuf)); tfprintf (asmFile, "\t!fileprelude\n"); /* Let the port generate any global directives, etc. */ -- 2.47.2