From: <sil...@li...> - 2005-05-27 10:21:24
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15353/src/GrCompiler/GdlPp Modified Files: cpp1.c cpp6.c memory.c Log Message: Get GrCompiler working on Linux Index: cpp1.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp1.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cpp1.c 25 Oct 2004 19:08:41 -0000 1.2 +++ cpp1.c 27 May 2005 10:21:14 -0000 1.3 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.3 2005/05/27 10:21:14 mhosken + * Get GrCompiler working on Linux + * * Revision 1.2 2004/10/25 19:08:41 danglassey * gcc prefers some extra brackets - remove warnings * @@ -680,7 +683,7 @@ */ if(!global->out) return; -#if defined(UNIX) +#if defined(unix) if(global->output) global->output(c, global->userdata); else Index: cpp6.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp6.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cpp6.c 25 Oct 2004 19:08:41 -0000 1.2 +++ cpp6.c 27 May 2005 10:21:14 -0000 1.3 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.3 2005/05/27 10:21:14 mhosken + * Get GrCompiler working on Linux + * * Revision 1.2 2004/10/25 19:08:41 danglassey * gcc prefers some extra brackets - remove warnings * @@ -1178,7 +1181,7 @@ MSG_PREFIX, tp, global->infile->fp?global->line:file->line, severity); if(global->error) global->error(global->userdata, ErrorMessage[error], arg); -#if defined(UNIX) +#if defined(unix) else vfprintf(stderr, ErrorMessage[error], arg); #elif defined(AMIGA) @@ -1226,7 +1229,7 @@ va_start(arg, format); if(global->error) global->error(global->userdata, format, arg); -#if defined(UNIX) +#if defined(unix) else vfprintf(stderr, format, arg); #endif Index: memory.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/memory.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- memory.c 25 Oct 2004 19:08:41 -0000 1.2 +++ memory.c 27 May 2005 10:21:14 -0000 1.3 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.3 2005/05/27 10:21:14 mhosken + * Get GrCompiler working on Linux + * * Revision 1.2 2004/10/25 19:08:41 danglassey * gcc prefers some extra brackets - remove warnings * @@ -34,7 +37,7 @@ #include <stdlib.h> #if defined(OS9) #include <types.h> -#elif defined(UNIX) +#elif defined(unix) #include <sys/types.h> #elif defined(AMIGA) #include <exec/types.h> @@ -83,7 +86,7 @@ void *Malloc(int size) { - char *alloc; + char *alloc = NULL; struct MemInfo *point; #ifdef DEBUG @@ -92,7 +95,7 @@ #ifdef AMIGA alloc=(char *)AllocMem(size+sizeof(struct MemInfo), 0L); -#elif defined(UNIX) +#elif defined(unix) alloc=(char *)malloc(size+sizeof(struct MemInfo)); #endif @@ -149,7 +152,7 @@ #ifdef AMIGA FreeMem(point, point->size+sizeof(struct MemInfo)); -#elif UNIX +#elif unix free(point); #endif } @@ -167,7 +170,7 @@ b++; if(b) { -#if defined(UNIX) +#if defined(unix) fprintf(stderr, "Memory violation: malloc(%d) was abused %d bytes!\n", point->size-MEMORY_COOKIE-sizeof(struct MemInfo), b); #elif defined(AMIGA) @@ -195,7 +198,7 @@ #endif #ifdef AMIGA FreeMem(MallocKey, point->size+sizeof(struct MemInfo)); -#elif UNIX +#elif unix free((char *)MallocKey); #endif } while((MallocKey=prev)); |