git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2436
4a8a32a2-be11-0410-ad9d-
d568d2c75423
/* SDCCglobl.h - global macros etc required by all files */
/* SDCCglobl.h - global macros etc required by all files */
#ifndef SDCCGLOBL_H
#define SDCCGLOBL_H
#ifndef SDCCGLOBL_H
#define SDCCGLOBL_H
#include <memory.h>
#include <assert.h>
#include <stdlib.h>
#include <setjmp.h>
#include <stdio.h>
#include <memory.h>
#include <assert.h>
#include <stdlib.h>
#include <setjmp.h>
#include <stdio.h>
+#include "SDCCset.h"
+
+
/*
* Define host port dependant constants etc.
*/
/*
* Define host port dependant constants etc.
*/
extern char *libPaths[128];
extern int nlibPaths;
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
void parseWithComma (char **, char *);
/** Creates a temporary file a'la tmpfile which avoids the bugs
unsigned maxInterrupts = 6;
int allocInfo = 1;
symbol *mainf;
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. */
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. */
time_t t;
time (&t);
fprintf (afile, "%s", iComments1);
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);
}
fprintf (afile, "%s", iComments2);
}
+
+/*-----------------------------------------------------------------*/
+/* 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 */
/*-----------------------------------------------------------------*/
/*-----------------------------------------------------------------*/
/* glue - the final glue that hold the whole thing together */
/*-----------------------------------------------------------------*/
FILE *vFile;
FILE *asmFile;
FILE *ovrFile = tempfile ();
FILE *vFile;
FILE *asmFile;
FILE *ovrFile = tempfile ();
+ char moduleBuf[PATH_MAX];
addSetHead (&tmpfileSet, ovrFile);
/* print the global struct definitions */
addSetHead (&tmpfileSet, ovrFile);
/* print the global struct definitions */
initialComments (asmFile);
/* print module name */
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. */
tfprintf (asmFile, "\t!fileprelude\n");
/* Let the port generate any global directives, etc. */