# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "INDEXLIB" /D "MLH_MAP" /D "SDK" /FR /YX /J /FD /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "INDEXLIB" /D "MLH_MAP" /D "SDK" /FR /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "INDEXLIB" /D "MLH_MAP" /D "SDK" /J /FD /GZ /c
-# SUBTRACT CPP /WX /Fr
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "INDEXLIB" /D "MLH_MAP" /D "SDK" /J /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /J /FD /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /J /FD /GZ /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /J /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G3 /Zp1 /W3 /WX /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /J /FD /c
+# ADD CPP /nologo /G3 /Zp1 /W3 /WX /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /J /FD /GZ /c
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /J /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
/*)Module asdata.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
/*)Module asexpr.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
/*)Module aslex.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include <stdlib.h>
#include "asm.h"
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <unistd.h>
-#include <alloc.h>
-#endif
+
+//#if defined(_MSC_VER)
+//#include <stdlib.h>
+//#else // _MSC_VER
+//#include <alloc.h>
+//#endif // _MSC_VER
+
#include "asm.h"
extern VOID machine(struct mne *);
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
/* Return basic file name without path or extension */
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
/*
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
/*)Module assubr.c
#include <stdio.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*)Module lkarea.c
#include <stdio.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*)Module lkdata.c
#include <stdio.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*)Module lkeval.c
#include <stdio.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*Module lkhead.c
#include <stdio.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*)Module lkihx.c
#include <stdio.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*)Module lklex.c
#include <stdio.h>
#include <string.h>
-#if defined(_MSC_VER)
-#include <malloc.h>
-#else
-#include <alloc.h>
-#endif
+//#if defined(_MSC_VER)
+//#include <malloc.h>
+//#else
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*)Module lklibr.c
#include <stdio.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include <stdlib.h>
#include "aslink.h"
#include <stdio.h>
#include <string.h>
-#if defined(_MSC_VER)
-#include <stdlib.h>
-#else
-#include <alloc.h>
-#endif
+//#if defined(_MSC_VER)
+//#include <stdlib.h>
+//#else
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/* yuck - but including unistd.h causes problems on Cygwin by redefining
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
static void DefineGlobal( char *name, Addr_T value, int page );
#include <stdio.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*)Module lkrloc.c
#include <stdio.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*)Module lks19.c
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "aslink.h"
/*
/* DECUS C */
#ifndef SDK
-extern char *alloc();
-extern char *malloc();
-extern char *calloc();
-extern char *realloc();
+//extern char *alloc();
+//extern char *malloc();
+//extern char *calloc();
+//extern char *realloc();
#endif
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
#include <setjmp.h>
#include <string.h>
+//#include "newalloc.h"
#if defined(_MSC_VER)
#include <malloc.h>
#else
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#ifdef SDK
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
#include <setjmp.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
+//#if !defined(_MSC_VER)
+//#include <alloc.h>
+//#endif
#include "asm.h"
char simbuf[50];
/* allocate & init a new bp */
- ALLOC(bp,sizeof(breakp));
+ Safe_calloc(bp,sizeof(breakp));
bp->addr = addr;
bp->addrType = addrType;
bp->bpType = bpType;
char *gc_strdup(const char *s)
{
char *ret;
- ALLOC_ATOMIC(ret, strlen(s)+1);
+ Safe_calloc(ret, strlen(s)+1);
strcpy(ret, s);
return ret;
}
if (!size)
return NULL;
- ALLOC(d,size+1);
+ Safe_calloc(d,size+1);
memcpy(d,s,size);
d[size] = '\0';
void **vptr;
if (array)
- vptr = realloc(array,newSize*(sizeof(void **)));
+ vptr = Safe_realloc(array,newSize*(sizeof(void **)));
else
vptr = calloc(1, sizeof(void **));
if (!(bp = fgets(buffer,sizeof(buffer),file)))
return 0;
- ALLOC(currl,sizeof(cdbrecs));
+ Safe_calloc(currl,sizeof(cdbrecs));
recsRoot = currl ;
while (1) {
}
bp += 2;
- ALLOC(currl->line,strlen(bp));
+ Safe_calloc(currl->line,strlen(bp));
strncpy(currl->line,bp,strlen(bp)-1);
currl->line[strlen(bp)-1] = '\0';
}
if (feof(file))
break;
- ALLOC(currl->next,sizeof(cdbrecs));
+ Safe_calloc(currl->next,sizeof(cdbrecs));
currl = currl->next;
}
slines = (srcLine **)resize((void **)slines,*nlines);
- ALLOC(slines[(*nlines)-1],sizeof(srcLine));
+ Safe_calloc(slines[(*nlines)-1],sizeof(srcLine));
slines[(*nlines)-1]->src = alloccpy(bp,strlen(bp));
}
if (func->exitline < j)
func->exitline = j;
- ALLOC(ep,sizeof(exePoint));
+ Safe_calloc(ep,sizeof(exePoint));
ep->addr = mod->cLines[j]->addr ;
ep->line = j;
ep->block= mod->cLines[j]->block;
func->aexitline = j;
/* add it to the execution point */
- ALLOC(ep,sizeof(exePoint));
+ Safe_calloc(ep,sizeof(exePoint));
ep->addr = mod->asmLines[j]->addr ;
ep->line = j;
addSet(&func->afpoints,ep);
}
/* allocate for context */
- ALLOC(currCtxt ,sizeof(context));
+ Safe_calloc(currCtxt ,sizeof(context));
/* readin the debug information */
if (!readCdb (cdbFile)) {
if (!ssdirl)
ssdirl = &argv[i][12];
else {
- char *p = malloc(strlen(ssdirl)+strlen(&argv[i][12])+2);
+ char *p = Safe_malloc(strlen(ssdirl)+strlen(&argv[i][12])+2);
strcat(strcat(strcpy(p,&argv[i][12]),":"),ssdirl);
ssdirl = p;
}
#define min(a,b) (a < b ? a : b)
#endif
-#ifndef ALLOC
-#define ALLOC(x,sz) if (!(x = calloc(1, sz))) \
- { \
- fprintf(stderr,"sdcdb: out of memory\n"); \
- exit (1); \
- }
-#endif
-#ifndef ALLOC_ATOMIC
-#define ALLOC_ATOMIC(x,sz) if (!(x = calloc(1, sz))) \
- { \
- fprintf(stderr,"sdcdb: out of memory\n"); \
- exit (1); \
- }
-#endif
+//#ifndef ALLOC
+//#define ALLOC(x,sz) if (!(x = calloc(1, sz))) \
+// { \
+// fprintf(stderr,"sdcdb: out of memory\n"); \
+// exit (1); \
+// }
+//#endif
+//#ifndef ALLOC_ATOMIC
+//#define ALLOC_ATOMIC(x,sz) if (!(x = calloc(1, sz))) \
+// { \
+// fprintf(stderr,"sdcdb: out of memory\n"); \
+// exit (1); \
+// }
+//#endif
/* generalpurpose stack related macros */
#define STACK_DCL(stack,type,size) \
typedef type t_##stack ; \
function *func ;
char *rs;
int i;
- ALLOC(func,sizeof(function));
+ Safe_calloc(func,sizeof(function));
func->sym = parseSymbol(line,&rs);
func->sym->isfunc = 1;
func->modName = currModName ;
s = ++bp;
while (*s != ')') { /* till we reach the end */
link *type;
- ALLOC(type,sizeof(link));
+ Safe_calloc(type,sizeof(link));
if (*s == ',') s++;
/* is a declarator */
symbol *nsym ;
char *bp = s;
- ALLOC(nsym,sizeof(symbol));
+ Safe_calloc(nsym,sizeof(symbol));
/* copy over the mangled name */
while (*bp != '(') bp++;
module *nmod ;
char buffer[512];
- ALLOC(nmod,sizeof(module));
+ Safe_calloc(nmod,sizeof(module));
addSet (&modules,nmod);
if (createName) {
sprintf(buffer,"%s.c",s);
- ALLOC(nmod->c_name,strlen(buffer)+1);
+ Safe_calloc(nmod->c_name,strlen(buffer)+1);
strcpy(nmod->c_name,buffer);
sprintf(buffer,"%s.asm",s);
- ALLOC(nmod->asm_name,strlen(buffer)+1);
+ Safe_calloc(nmod->asm_name,strlen(buffer)+1);
strcpy(nmod->asm_name,buffer);
}
return structs[i];
}
- ALLOC(nsdef,sizeof(structdef));
+ Safe_calloc(nsdef,sizeof(structdef));
nsdef->tag = alloccpy(s,strlen(s));
nsdef->sname = currModName ;
/*-----------------------------------------------------------------
- printfl.c - source file for reduced version of printf
-
+ printfl.c - source file for reduced version of printf
+
Written By - Sandeep Dutta . sandeep.dutta@usa.net (1999)
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
+
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding!
+ what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
/* following formats are supported :-
format output type argument-type
%d decimal int
- %ld decimal long
+ %ld decimal long
%hd decimal short/char
%x hexadecimal int
- %lx hexadecimal long
+ %lx hexadecimal long
%hx hexadecimal short/char
%o octal int
- %lo octal long
+ %lo octal long
%ho octal short/char
%c character char/short
%s character _generic pointer
static void pvalhex( long val)
{
- volatile char sp = SP;
- unsigned long lval = val;
+ volatile char sp = SP;
+ unsigned long lval = val;
- if (!long_flag)
- lval &= 0x0000ffff;
+ if (!long_flag)
+ lval &= 0x0000ffff;
if (short_flag)
- lval &= 0x000000ff;
+ lval &= 0x000000ff;
- while (lval) {
- ch = "0123456789ABCDEF"[(unsigned short)lval & 0x0f];
- _asm push _ch _endasm;
- lval /= 16;
- }
+ while (lval) {
+ ch = "0123456789ABCDEF"[(unsigned short)lval & 0x0f];
+ _asm push _ch _endasm;
+ lval /= 16;
+ }
- while (sp != SP) {
- _asm pop _ch _endasm;
- putchar(ch);
+ while (sp != SP) {
+ _asm pop _ch _endasm;
+ putchar(ch);
}
-
+
}
-static void pvaloct(long val)
+static void pvaloct(long val)
{
- char sp ;
- unsigned long lval;
- sp = SP;
- if (val < 0) {
- lval = -val;
- sign = 1;
- } else {
- lval = val;
- sign = 0;
- }
-
- if (!long_flag)
- lval &= 0x0000ffff;
+ char sp ;
+ unsigned long lval;
+ sp = SP;
+ if (val < 0) {
+ lval = -val;
+ sign = 1;
+ } else {
+ lval = val;
+ sign = 0;
+ }
+
+ if (!long_flag)
+ lval &= 0x0000ffff;
if (short_flag)
- lval &= 0x000000ff;
+ lval &= 0x000000ff;
while (lval) {
- ch = (lval % 8) + '0';
- _asm push _ch _endasm;
+ ch = (lval % 8) + '0';
+ _asm push _ch _endasm;
lval = lval / 8;
- }
-
- if (sign) {
- ch = '-';
- _asm push _ch _endasm;
- }
-
-
- while (sp != SP) {
- _asm pop _ch _endasm;
- putchar(ch);
+ }
+
+ if (sign) {
+ ch = '-';
+ _asm push _ch _endasm;
+ }
+
+
+ while (sp != SP) {
+ _asm pop _ch _endasm;
+ putchar(ch);
}
}
-static void pvaldec(long val )
+static void pvaldec(long val )
{
- char sp ;
- unsigned long lval;
- sp = SP;
- if (val < 0) {
- lval = -val;
- sign = 1;
- } else {
- lval = val;
- sign = 0;
- }
-
+ char sp ;
+ unsigned long lval;
+ sp = SP;
+ if (val < 0) {
+ lval = -val;
+ sign = 1;
+ } else {
+ lval = val;
+ sign = 0;
+ }
+
while (lval) {
- ch = (lval % 10) + '0';
- _asm push _ch _endasm;
+ ch = (lval % 10) + '0';
+ _asm push _ch _endasm;
lval = lval / 10;
- }
-
- if (sign) {
- ch = '-';
- _asm push _ch _endasm;
- }
-
-
- while (sp != SP) {
- _asm pop _ch _endasm;
- putchar(ch);
+ }
+
+ if (sign) {
+ ch = '-';
+ _asm push _ch _endasm;
+ }
+
+
+ while (sp != SP) {
+ _asm pop _ch _endasm;
+ putchar(ch);
}
}
void printf_small (char * fmt, ... ) reentrant
{
va_list ap ;
-
+
va_start(ap,fmt);
-
+
for (; *fmt ; fmt++ ) {
- if (*fmt == '%') {
- long_flag = string_flag = short_flag = 0;
- fmt++ ;
- switch (*fmt) {
- case 'l':
- long_flag = 1;
- fmt++;
- break;
- case 'h':
- short_flag = 1;
- fmt++;
- }
-
- switch (*fmt) {
- case 's':
- string_flag = 1;
- break;
- case 'd':
- radix = 10;
- break;
- case 'x':
- radix = 16;
- break;
- case 'c':
- radix = 0;
- break;
- case 'o':
- radix = 8;
- break;
- }
-
- if (string_flag) {
- str = va_arg(ap,char _generic *);
- while (*str) putchar(*str++);
- continue ;
- }
-
- if (long_flag)
- val = va_arg(ap,long);
- else
- if (short_flag)
- val = va_arg(ap,short);
- else
- val = va_arg(ap,int);
-
+ if (*fmt == '%') {
+ long_flag = string_flag = short_flag = 0;
+ fmt++ ;
+ switch (*fmt) {
+ case 'l':
+ long_flag = 1;
+ fmt++;
+ break;
+ case 'h':
+ short_flag = 1;
+ fmt++;
+ }
+
+ switch (*fmt) {
+ case 's':
+ string_flag = 1;
+ break;
+ case 'd':
+ radix = 10;
+ break;
+ case 'x':
+ radix = 16;
+ break;
+ case 'c':
+ radix = 0;
+ break;
+ case 'o':
+ radix = 8;
+ break;
+ }
+
+ if (string_flag) {
+ str = va_arg(ap,char _generic *);
+ while (*str) putchar(*str++);
+ continue ;
+ }
+
+ if (long_flag)
+ val = va_arg(ap,long);
+ else
+ if (short_flag)
+ val = va_arg(ap,short);
+ else
+ val = va_arg(ap,int);
+
switch (radix) {
- case 10:
- pvaldec(val) ;
- break;
- case 16:
- pvalhex (val);
- break;
- case 0:
- putchar((char)val);
- break;
- case 8:
- pvaloct(val) ;
- break;
- }
-
- } else
- putchar(*fmt);
- }
+ case 10:
+ pvaldec(val) ;
+ break;
+ case 16:
+ pvalhex (val);
+ break;
+ case 0:
+ putchar((char)val);
+ break;
+ case 8:
+ pvaloct(val) ;
+ break;
+ }
+
+ } else
+ putchar(*fmt);
+ }
}
relfil[NINPUT+1] = '\0';
relfil[strlen(relfil) - 1] = '\0';
if (path != NULL) {
- str = (char *)malloc(strlen(path)+strlen(relfil)+6);
+ str = (char *)Safe_malloc(strlen(path)+strlen(relfil)+6);
strcpy(str,path);
#ifdef OTHERSYSTEM
#ifdef SDK
}
#endif
} else {
- str = (char *)malloc(strlen(relfil) + 5);
+ str = (char *)Safe_malloc(strlen(relfil) + 5);
}
#ifdef SDK
#ifdef UNIX
/*3*/ if ((fp = fopen(str, "r")) != NULL) {
/* Opened OK - create a new libraryfile object for it */
- This->next = (pmlibraryfile)malloc( sizeof( mlibraryfile ));
+ This->next = (pmlibraryfile)Safe_malloc( sizeof( mlibraryfile ));
if (This->next == NULL) {
printf("panic: cant allocate memory.\n");
exit(-1);
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G3 /Zp1 /W3 /WX /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /J /FD /c
+# ADD CPP /nologo /G3 /Zp1 /W3 /WX /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /J /FD /GZ /c
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /J /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
#undef OPT_DISABLE_GBZ80
#undef OPT_DISABLE_MCS51
#undef OPT_DISABLE_AVR
+#define OPT_DISABLE_I186 1
+#define OPT_DISABLE_TLCS900H 1
#endif
#include <string.h>
#include <ctype.h>
#include "common.h"
+#include "newalloc.h"
char *stringLiteral();
char *currFname;
/* mark the end of the filename */
while (*s != '"') s++;
*s = '\0';
- ALLOC(currFname,strlen(sb)+1);
+ currFname = Safe_calloc(strlen(sb)+1);
strcpy(currFname,sb);
yylineno = lNum - 2;
}
#include "SDCCmem.h"
#include "SDCCast.h"
#include "port.h"
+#include "newalloc.h"
extern int yyerror (char *);
extern FILE *yyin;
| jump_statement
| INLINEASM ';' {
ast *ex = newNode(INLINEASM,NULL,NULL);
- ALLOC(ex->values.inlineasm,strlen($1));
+ ex->values.inlineasm = Safe_calloc(strlen($1));
strcpy(ex->values.inlineasm,$1);
$$ = ex;
}
-------------------------------------------------------------------------*/
#include "common.h"
+#include "newalloc.h"
int eBBNum = 0;
set *graphEdges = NULL ; /* list of edges in this flow graph */
{
eBBlock *ebb;
- ALLOC(ebb,sizeof(eBBlock));
+ ebb = Safe_calloc(sizeof(eBBlock));
return ebb ;
}
{
edge *ep ;
- ALLOC(ep,sizeof(edge));
+ ep = Safe_calloc(sizeof(edge));
ep->from = from;
ep->to = to;
*count = 0 ;
/* allocate for the first entry */
- ALLOC(ebbs,sizeof(eBBlock **));
+
+ ebbs = Safe_calloc(sizeof(eBBlock **));
while (loop) {
/* put it in the array */
ebbs[(*count)++] = ebb ;
- /* allocate for the next one. Remember to clear the new */
- /* pointer at the end, that was created by realloc. */
- if (!(ebbs = realloc(ebbs,(*count + 1)*sizeof(eBBlock **)))) {
- werror(E_OUT_OF_MEM,__FILE__,(*count + 1)*sizeof(eBBlock **));
- exit (1);
- }
+ /* allocate for the next one. Remember to clear the new */
+ /* pointer at the end, that was created by realloc. */
+
+ ebbs = Safe_realloc(ebbs,(*count + 1)*sizeof(eBBlock **)) ;
ebbs[*count] = 0;
}
(*count)++ ;
+
/* if we have stopped at the block , allocate for an extra one */
- if (!(ebbs = realloc(ebbs,(*count + 1)*sizeof(eBBlock **)))) {
- werror(E_OUT_OF_MEM,__FILE__,(*count + 1)*sizeof(eBBlock **));
- exit (1);
- }
+
+ ebbs = Safe_realloc(ebbs,(*count + 1)*sizeof(eBBlock **)) ;
+
ebbs[*count] = 0;
/* then move the block down one count */
int otherPathsPresent (eBBlock **,eBBlock *);
void replaceLabel(eBBlock *,symbol *,symbol *);
void dumpEbbsToFileExt (char *,eBBlock **,int);
+
+#if defined(_MSC_VER)
+
+/*-----------------------------------------------------------------*/
+/* dumpLiveRanges - dump liverange information into a file */
+/*-----------------------------------------------------------------*/
+
+void dumpLiveRanges (char *ext,hTab *liveRanges) ;
+
+#endif // _MSC_VER
+
#endif
-------------------------------------------------------------------------*/
#include "common.h"
+#include "newalloc.h"
int currLineno = 0;
set *astList = NULL ;
ast *ex ;
static int oldLineno = 0 ;
- ALLOC(ex,sizeof(ast));
+ Safe_calloc(ex,sizeof(ast));
ex->type = type ;
ex->lineno = (noLineno ? oldLineno : yylineno);
ast *ex ;
static int oldLineno = 0 ;
- ALLOC(ex,sizeof(ast));
+ ex = Safe_calloc(sizeof(ast));
ex->type = type ;
ex->lineno = (noLineno ? oldLineno : yylineno);
break ;
case INLINEASM:
- ALLOC(dest->values.inlineasm,strlen(src->values.inlineasm));
+ dest->values.inlineasm = Safe_calloc(strlen(src->values.inlineasm));
strcpy(dest->values.inlineasm,src->values.inlineasm);
case FOR:
if (!src) return NULL ;
- ALLOC(dest,sizeof(ast));
+ dest = Safe_calloc(sizeof(ast));
dest->type = src->type ;
dest->lineno = src->lineno ;
#include "common.h"
+#include "newalloc.h"
+
int bitVectDefault = 1024;
/* genernal note about a bitvectors:
bitVect *bvp;
int byteSize ;
- ALLOC(bvp,sizeof (bitVect));
+ bvp = Safe_calloc(sizeof (bitVect));
bvp->size = size;
bvp->bSize = byteSize = ( size / 8) + 1 ;
- ALLOC(bvp->vect,byteSize);
+ bvp->vect = Safe_calloc(byteSize);
return bvp;
}
return bvp;
}
+ bvp->vect = Clear_realloc(bvp->vect, bvp -> bSize, bSize);
bvp->size = size;
bvp->bSize= bSize;
- bvp->vect = realloc(bvp->vect, bSize);
+
return bvp;
}
-------------------------------------------------------------------------*/
#include "common.h"
+#include "newalloc.h"
/*-----------------------------------------------------------------*/
/* newCseDef - new cseDef */
cseDef *cdp ;
assert (sym);
- ALLOC(cdp,sizeof(cseDef));
+ cdp = Safe_calloc(sizeof(cseDef));
cdp->sym = sym;
cdp->diCode = ic;
type *type##FreeStack [size] ; \
int type##StackPtr = 0 ;
-#define ALLOC(x,sz) if (!(x = calloc(1, sz))) \
- { \
- werror(E_OUT_OF_MEM,__FILE__,(long) sz);\
- exit (1); \
- }
-
-
-#define ALLOCTYPE(type,size) if (!(type##Pool = calloc(1, size*sizeof(type))))\
- { \
- werror(E_OUT_OF_MEM,__FILE__,(long) size); \
- exit (1); \
- }
+//#define ALLOC(x,sz) if (!(x = calloc(1, sz))) \
+// { \
+// werror(E_OUT_OF_MEM,__FILE__,(long) sz);\
+// exit (1); \
+// }
+
+
+//#define ALLOCTYPE(type,size) if (!(type##Pool = calloc(1, size*sizeof(type))))\
+// { \
+// werror(E_OUT_OF_MEM,__FILE__,(long) size); \
+// exit (1); \
+// }
#define PUSH(x,y) x##FreeStack[x##StackPtr++] = y
#define PEEK(x) x##FreeStack[x##StackPtr-1]
#include "common.h"
#include "asm.h"
#include <time.h>
+#include "newalloc.h"
#if !defined(__BORLANDC__) && !defined(_MSC_VER)
#if 0 /* This should no longer be necessary. */
/* Hmm. Too big for now. */
assert(0);
}
- ALLOC(rs,strlen(buffer)+1);
+ rs = Safe_calloc(strlen(buffer)+1);
return strcpy (rs,buffer);
}
#else
tsprintf(buffer, "!immedbyte", fl.c[offset]);
#endif
- ALLOC(rs,strlen(buffer)+1);
+ rs = Safe_calloc(strlen(buffer)+1);
return strcpy (rs,buffer);
}
*/
FILE *tempfile(void)
{
+#if !defined(_MSC_VER)
const char *tmpdir = NULL;
if (getenv("TMP"))
tmpdir = getenv("TMP");
}
return NULL;
}
+#endif
return tmpfile();
}
char *gc_strdup(const char *s)
{
char *ret;
- ALLOC(ret, strlen(s)+1);
+ ret = Safe_calloc(strlen(s)+1);
strcpy(ret, s);
return ret;
}
#include <assert.h>
#include "SDCCglobl.h"
#include "SDCChasht.h"
+#include "newalloc.h"
#define DEFAULT_HTAB_SIZE 128
{
hashtItem *htip;
- ALLOC(htip,sizeof(hashtItem));
+ htip = Safe_calloc(sizeof(hashtItem));
htip->key = key ;
htip->pkey = pkey;
{
hTab *htab;
- ALLOC(htab,sizeof(hTab));
+ htab = Safe_calloc(sizeof(hTab));
if (!(htab->table = calloc((size +1), sizeof(hashtItem *)))) {
fprintf(stderr,"out of virtual memory %s %d\n",
if (key > (*htab)->size ) {
int i;
- (*htab)->table = realloc ((*htab)->table,
+ (*htab)->table = Safe_realloc ((*htab)->table,
(key*2 + 2)*sizeof(hashtItem *));
for ( i = (*htab)->size +1; i <= (key*2 + 1); i++ )
(*htab)->table[i] = NULL ;
-------------------------------------------------------------------------*/
#include "common.h"
+#include "newalloc.h"
/*-----------------------------------------------------------------*/
/* global variables */
{
operand *op ;
- ALLOC(op,sizeof(operand));
+ op = Safe_calloc(sizeof(operand));
op->key = 0 ;
return op;
{
iCode *ic ;
- ALLOC(ic,sizeof(iCode));
+ ic = Safe_calloc(sizeof(iCode));
ic->lineno = lineno ;
ic->filename= filename ;
-------------------------------------------------------------------------*/
#include "common.h"
+#include "newalloc.h"
DEFSETFUNC(isDefAlive);
{
induction *ip;
- ALLOC(ip,sizeof(induction));
+ ip = Safe_calloc(sizeof(induction));
ip->sym = sym;
ip->asym= asym;
{
region *lp ;
- ALLOC(lp,sizeof(region));
+ lp = Safe_calloc(sizeof(region));
return lp;
}
#include "common.h"
#include <ctype.h>
+#include "newalloc.h"
#if NATIVE_WIN32
#include <process.h>
bool verboseExec = FALSE;
char *preOutName;
+// In MSC VC6 default search path for exe's to path for this
+
+#if defined(_MSC_VER)
+
+char DefaultExePath[_MAX_PATH] ;
+
+#endif
+
/* Far functions, far data */
#define OPTION_LARGE_MODEL "-model-large"
/* Far functions, near data */
/* get rid of the "." */
strtok(buffer,".");
- ALLOC(srcFileName,strlen(buffer)+1);
+ srcFileName = Safe_calloc(strlen(buffer)+1);
strcpy(srcFileName,buffer);
/* get rid of any path information
*(fext-1) != '/' &&
*(fext-1) != ':')
fext--;
- ALLOC(moduleName,strlen(fext)+1);
+ moduleName = Safe_calloc(strlen(fext)+1);
strcpy(moduleName,fext);
return ;
#if defined(_MSC_VER)
-char *try_dir[]= {NULL}; // TODO : Fill in some default search list
+char *try_dir[]= {DefaultExePath, NULL}; // TODO : Fill in some default search list
#else
}
return e;
}
+
#else
+
int my_system (const char *cmd, char **cmd_argv)
{
char *dir, *got= NULL; int i= 0;
while (!got && try_dir[i])
{
- dir= (char*)malloc(strlen(try_dir[i])+strlen(cmd)+10);
+ dir= (char*)Safe_malloc(strlen(try_dir[i])+strlen(cmd)+10);
strcpy(dir, try_dir[i]);
strcat(dir, "/");
strcat(dir, cmd);
if (port->init)
port->init();
+#if defined(_MSC_VER)
+
+ {
+ int i ;
+
+ // Create a default exe search path from the path to the sdcc command
+
+ strcpy(DefaultExePath,argv[0]) ;
+
+ for(i = strlen(DefaultExePath) ; i > 0 ; i--)
+ if (DefaultExePath[i] == '\\')
+ {
+ DefaultExePath[i] = '\0' ;
+ break ;
+ }
+
+ if (i == 0)
+ DefaultExePath[0] = '\0' ;
+ }
+
+#endif
+
setDefaultOptions();
parseCmdLine(argc,argv);
return 0;
-}
+ }
#include "common.h"
#include "SDCCpeeph.h"
+#include "newalloc.h"
peepRule *rootRules = NULL;
peepRule *currRule = NULL;
{
peepRule *pr ;
- ALLOC(pr,sizeof(peepRule));
+ pr= Safe_calloc(sizeof(peepRule));
pr->match = match;
pr->replace= replace;
pr->restart = restart;
if (cond && *cond) {
- ALLOC(pr->cond,strlen(cond)+1);
+ pr->cond = Safe_calloc(strlen(cond)+1);
strcpy(pr->cond,cond);
} else
pr->cond = NULL ;
{
lineNode *pl;
- ALLOC(pl,sizeof(lineNode));
- ALLOC(pl->line,strlen(line)+1);
+ pl = Safe_calloc(sizeof(lineNode));
+ pl->line = Safe_calloc(strlen(line)+1);
strcpy(pl->line,line);
return pl;
}
*s = vvx ;
*vv = '\0';
/* got value */
- ALLOC(vvx,strlen(vval)+1);
+ vvx = Safe_calloc(strlen(vval)+1);
strcpy(vvx,vval);
hTabAddItem(vtab,key,vvx);
{
labelHashEntry *entry;
- ALLOC(entry, sizeof(labelHashEntry));
-
- assert(entry != NULL);
+ entry = Safe_calloc(sizeof(labelHashEntry));
memcpy(entry->name, label, labelLen);
entry->name[labelLen] = 0;
lb[nch] = '\0';
/* copy it into allocated buffer */
if (rs) {
- rs = realloc(rs,strlen(rs)+strlen(lb)+1);
+ rs = Safe_realloc(rs,strlen(rs)+strlen(lb)+1);
strcat(rs,lb);
} else {
- ALLOC(rs,strlen(lb)+1);
+ rs = Safe_calloc(strlen(lb)+1);
strcpy(rs,lb);
}
nch = 0 ;
lb[nch] = '\0';
/* copy it into allocated buffer */
if (rs) {
- rs = realloc(rs,strlen(rs)+strlen(lb)+1);
+ rs = Safe_realloc(rs,strlen(rs)+strlen(lb)+1);
strcat(rs,lb);
} else {
- ALLOC(rs,strlen(lb)+1);
+ rs = Safe_calloc(strlen(lb)+1);
strcpy(rs,lb);
}
}
-------------------------------------------------------------------------*/
#include <stdio.h>
-#include <malloc.h>
+#include "newalloc.h"
#include <assert.h>
#include "SDCCset.h"
{
set *lp ;
- lp = calloc(1, sizeof(set));
- if (lp == 0) {
- fprintf(stderr, "out of virtual memory: %s\n", __FILE__);
- exit(1);
- }
+ lp = Safe_calloc(sizeof(set));
+// if (lp == 0) {
+// fprintf(stderr, "out of virtual memory: %s\n", __FILE__);
+// exit(1);
+// }
lp->item = lp->curr= lp->next = NULL;
return lp;
-------------------------------------------------------------------------*/
#include "common.h"
+#include "newalloc.h"
bucket *SymbolTab [256] ; /* the symbol table */
bucket *StructTab [256] ; /* the structure table */
{
bucket *bp ;
- ALLOC(bp,sizeof(bucket));
+ bp = Safe_calloc(sizeof(bucket));
return bp ;
}
/* the symbols are always added at the head of the list */
i = hashKey(sname) ;
/* get a free entry */
- ALLOC(bp,sizeof(bucket));
+ bp = Safe_calloc(sizeof(bucket));
bp->sym = sym ; /* update the symbol pointer */
bp->level = level; /* update the nest level */
{
symbol *sym ;
- ALLOC(sym,sizeof(symbol));
+ sym = Safe_calloc(sizeof(symbol));
strcpy(sym->name,name); /* copy the name */
sym->level = scope ; /* set the level */
{
sym_link *p ;
- ALLOC(p,sizeof(sym_link));
+ p = Safe_calloc(sizeof(sym_link));
return p;
}
{
structdef *s;
- ALLOC(s,sizeof(structdef));
+ s = Safe_calloc(sizeof(structdef));
strcpy(s->tag,tag) ; /* copy the tag */
return s ;
#include <math.h>
#include <stdlib.h>
#include <limits.h>
+#include "newalloc.h"
int cNestLevel ;
{
value *val ;
- ALLOC(val,sizeof(value));
+ val = Safe_calloc(sizeof(value));
return val ;
}
initList *nilist;
- ALLOC(nilist,sizeof(initList));
+ nilist = Safe_calloc(sizeof(initList));
nilist->type = type ;
nilist->lineno = yylineno ;
SPEC_NOUN(val->etype) = V_CHAR ;
SPEC_SCLS(val->etype) = S_LITERAL;
- ALLOC(SPEC_CVAL(val->etype).v_char,strlen(s)+1);
+ SPEC_CVAL(val->etype).v_char = Safe_calloc(strlen(s)+1);
copyStr (SPEC_CVAL(val->etype).v_char,s);
return val;
}
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /J /FD /Zm500 /c
+# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /Zm500 /c
# SUBTRACT CPP /WX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /GZ /Zm500 /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support\util" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /GZ /Zm500 /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
#include <string.h>
#include <ctype.h>
#include "SDCCglobl.h"
+#include "newalloc.h"
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
{
asmop *aop;
- ALLOC(aop,sizeof(asmop));
+ aop = Safe_calloc(sizeof(asmop));
aop->type = type;
return aop;
}
/* special case for a function */
if (IS_FUNC(sym->type)) {
sym->aop = aop = newAsmop(AOP_IMMD);
- ALLOC(aop->aopu.aop_immd,strlen(sym->rname)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
strcpy(aop->aopu.aop_immd,sym->rname);
aop->size = FPTRSIZE;
return aop;
else
strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
- ALLOC(aop->aopu.aop_immd,strlen(buffer)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
strcpy(aop->aopu.aop_immd,buffer);
return aop;
}
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /Fp"Release/ds390.pch" /YX /J /FD /Zm500 /c
+# ADD CPP /nologo /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /Fp"Release/ds390.pch" /YX /FD /Zm500 /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /GZ /Zm500 /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support\util" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /GZ /Zm500 /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
#include "ralloc.h"
#include "gen.h"
#include "SDCCglobl.h"
+#include "newalloc.h"
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
{
asmop *aop;
- ALLOC(aop,sizeof(asmop));
+ aop = Safe_calloc(sizeof(asmop));
aop->type = type;
return aop;
}
/* special case for a function */
if (IS_FUNC(sym->type)) {
sym->aop = aop = newAsmop(AOP_IMMD);
- ALLOC(aop->aopu.aop_immd,strlen(sym->rname)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
strcpy(aop->aopu.aop_immd,sym->rname);
aop->size = FPTRSIZE;
return aop;
else
strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
- ALLOC(aop->aopu.aop_immd,strlen(buffer)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
strcpy(aop->aopu.aop_immd,buffer);
return aop;
}
return (dname ? "acc" : "a");
}
sprintf(s,"@%s",aop->aopu.aop_ptr->name);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
else
sprintf(s,"#%s",
aop->aopu.aop_immd);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
offset);
else
sprintf(s,"%s",aop->aopu.aop_dir);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
#include <string.h>
#include <ctype.h>
#include "SDCCglobl.h"
+#include "newalloc.h"
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
{
asmop *aop;
- ALLOC(aop,sizeof(asmop));
+ aop = Safe_calloc(sizeof(asmop));
aop->type = type;
return aop;
}
/* special case for a function */
if (IS_FUNC(sym->type)) {
sym->aop = aop = newAsmop(AOP_IMMD);
- ALLOC(aop->aopu.aop_immd,strlen(sym->rname)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
strcpy(aop->aopu.aop_immd,sym->rname);
aop->size = FPTRSIZE;
return aop;
else
strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
- ALLOC(aop->aopu.aop_immd,strlen(buffer)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
strcpy(aop->aopu.aop_immd,buffer);
return aop;
}
return (dname ? "acc" : "a");
}
sprintf(s,"@%s",aop->aopu.aop_ptr->name);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
else
sprintf(s,"#%s",
aop->aopu.aop_immd);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
offset);
else
sprintf(s,"%s",aop->aopu.aop_dir);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /J /FD /Zm500 /c
+# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /Zm500 /c
# SUBTRACT CPP /WX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /Zm500 /GZ /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support\util" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /Zm500 /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
/*-----------------------------------------------------------------*/
static void freeReg (regs *reg)
{
- reg->isFree = 1;
+ if (!reg)
+ {
+ werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+ "freeReg - Freeing NULL register");
+ exit(1);
+ }
+
+ reg->isFree = 1;
}
#include <string.h>
#include <ctype.h>
#include "SDCCglobl.h"
+#include "newalloc.h"
#if defined(_MSC_VER)
#define __FUNCTION__ __FILE__
{
asmop *aop;
- ALLOC(aop,sizeof(asmop));
+ aop = Safe_calloc(sizeof(asmop));
aop->type = type;
return aop;
}
/* special case for a function */
if (IS_FUNC(sym->type)) {
sym->aop = aop = newAsmop(AOP_IMMD);
- ALLOC(aop->aopu.aop_immd,strlen(sym->rname)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
strcpy(aop->aopu.aop_immd,sym->rname);
aop->size = FPTRSIZE;
return aop;
strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
//DEBUGemitcode(";","%s",buffer);
- ALLOC(aop->aopu.aop_immd,strlen(buffer)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
strcpy(aop->aopu.aop_immd,buffer);
return aop;
}
return (dname ? "acc" : "a");
}
sprintf(s,"@%s",aop->aopu.aop_ptr->name);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
else
sprintf(s,"%s",
aop->aopu.aop_immd);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
offset);
else
sprintf(s,"%s",aop->aopu.aop_dir);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
#include "../common.h"
#include <time.h>
#include "ralloc.h"
+#include "newalloc.h"
extern symbol *interrupts[256];
void printIval (symbol *, sym_link *, initList *, FILE *);
v >>= (offset * 8);
sprintf(buffer,"0x%02x",((char) v) & 0xff);
- ALLOC(rs,strlen(buffer)+1);
+ rs = Safe_calloc(strlen(buffer)+1);
return strcpy (rs,buffer);
}
#else
sprintf(buffer,"0x%02x",fl.c[offset]);
#endif
- ALLOC(rs,strlen(buffer)+1);
+ rs = Safe_calloc(strlen(buffer)+1);
return strcpy (rs,buffer);
}
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /J /FD /Zm500 /c
+# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /Zm500 /c
# SUBTRACT CPP /WX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /Zm500 /GZ /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support\util" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /Zm500 /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
#include "ralloc.h"
#include "gen.h"
+#if defined(_MSC_VER)
+#define __FUNCTION__ __FILE__
+#endif
+
/*-----------------------------------------------------------------*/
/* At this point we start getting processor specific although */
/* some routines are non-processor specific & can be reused when */
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
-# SUBTRACT CPP /WX /YX
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /I ".." /I "..\support\util" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /J /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# End Source File
# Begin Source File
+SOURCE=..\support\Util\NewAlloc.c
+# End Source File
+# Begin Source File
+
SOURCE=.\SDCC.lex
!IF "$(CFG)" == "src - Win32 Release"
# End Source File
# Begin Source File
-SOURCE=.\SDCCerr.c
+SOURCE=..\support\Util\sdccerr.c
# End Source File
# Begin Source File
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
+SOURCE=..\support\Util\newalloc.h
+# End Source File
+# Begin Source File
+
SOURCE=..\sdcc_vc.h
# End Source File
# Begin Source File
-SOURCE=.\SDCCalloc.h
+SOURCE=.\SDCCBBlock.h
# End Source File
# Begin Source File
#include "SDCCpeeph.h"
#include "gen.h"
#include "SDCCglue.h"
+#include "newalloc.h"
/* this is the down and dirty file with all kinds of kludgy & hacky
stuff. This is what it is all about CODE GENERATION for a specific MCU.
{
asmop *aop;
- ALLOC(aop,sizeof(asmop));
+ aop = Safe_calloc(sizeof(asmop));
aop->type = type;
return aop;
}
/* special case for a function */
if (IS_FUNC(sym->type)) {
sym->aop = aop = newAsmop(AOP_IMMD);
- ALLOC(aop->aopu.aop_immd,strlen(sym->rname)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
strcpy(aop->aopu.aop_immd,sym->rname);
aop->size = 2;
return aop;
break;
}
- ALLOC(aop->aopu.aop_immd,strlen(buffer)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
strcpy(aop->aopu.aop_immd,buffer);
return aop;
}
tsprintf(s, "!hashedstr + %d", aop->aopu.aop_immd, offset);
else
tsprintf(s, "%s + %d", aop->aopu.aop_immd, offset);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
case AOP_LIT: {
tsprintf(buffer, "!immedword", v);
else
tsprintf(buffer, "!constword", v);
- ALLOC(rs,strlen(buffer)+1);
+ rs = Safe_calloc(strlen(buffer)+1);
return strcpy (rs,buffer);
}
else {
tsprintf(buffer, "!immedword", f.w[offset/2]);
else
tsprintf(buffer, "!constword", f.w[offset/2]);
- ALLOC(rs,strlen(buffer)+1);
+ rs = Safe_calloc(strlen(buffer)+1);
return strcpy (rs,buffer);
}
}
default:
wassert(0);
}
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
wassert(IS_GB);
emitcode("ld", "a,(%s+%d) ; x", aop->aopu.aop_dir, offset);
sprintf(s, "a");
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
wassert(IS_GB);
emitcode("ldh", "a,(%s+%d) ; x", aop->aopu.aop_dir, offset);
sprintf(s, "a");
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
wassert(IS_Z80);
setupPair(PAIR_IY, aop, offset);
tsprintf(s,"!*iyx", offset);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
offset += _G.stack.param_offset;
tsprintf(s,"!*ixx ; x", aop->aopu.aop_stk+offset);
}
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /J /FD /Zm500 /c
+# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /Zm500 /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# PROP Intermediate_Dir ""
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /GZ /Zm500 /c
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /I ".." /I "." /I "..\.." /I "..\..\support\util" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /J /FD /GZ /Zm500 /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
!IF "$(CFG)" == "z80 - Win32 Release"
# Begin Custom Build
-InputPath=.\peeph-z80.def
+InputPath=".\peeph-z80.def"
"peeph-z80.rul" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
echo on
!ELSEIF "$(CFG)" == "z80 - Win32 Debug"
# Begin Custom Build
-InputPath=.\peeph-z80.def
+InputPath=".\peeph-z80.def"
"peeph-z80.rul peeph.rul peeph-gbz80.rul" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
echo on
--- /dev/null
+/*
+===============================================================================
+NEWALLOC - SDCC Memory allocation functions
+
+These functions are wrappers for the standard malloc, realloc and free
+functions.
+
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them. Help stamp out software-hoarding!
+
+===============================================================================
+*/
+
+//#include "SDCCerr.h"
+
+#include <stdio.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <memory.h>
+
+#include "newalloc.h"
+/*
+-------------------------------------------------------------------------------
+Clear_realloc - Reallocate a memory block and clear any memory added with
+out of memory error detection
+
+-------------------------------------------------------------------------------
+*/
+
+void *Clear_realloc(void *OldPtr,size_t OldSize,size_t NewSize)
+
+{
+void *NewPtr ;
+
+NewPtr = realloc(OldPtr,NewSize) ;
+
+if (!NewPtr)
+ {
+ printf("ERROR - No more memory\n") ;
+// werror(E_OUT_OF_MEM,__FILE__,NewSize);
+ exit (1);
+ }
+
+if (NewPtr)
+ if (NewSize > OldSize)
+ memset((char *) NewPtr + OldSize,0x00,NewSize - OldSize) ;
+
+return NewPtr ;
+}
+/*
+-------------------------------------------------------------------------------
+Safe_realloc - Reallocate a memory block with out of memory error detection
+
+-------------------------------------------------------------------------------
+*/
+
+void *Safe_realloc(void *OldPtr,size_t NewSize)
+
+{
+void *NewPtr ;
+
+NewPtr = realloc(OldPtr,NewSize) ;
+
+if (!NewPtr)
+ {
+ printf("ERROR - No more memory\n") ;
+// werror(E_OUT_OF_MEM,__FILE__,NewSize);
+ exit (1);
+ }
+
+return NewPtr ;
+}
+/*
+-------------------------------------------------------------------------------
+Safe_calloc - Allocate a block of memory from the application heap, clearing
+all data to zero and checking for out of memory errors.
+
+-------------------------------------------------------------------------------
+*/
+
+void *Safe_calloc(size_t Size)
+
+{
+void *NewPtr ;
+
+NewPtr = calloc(Size,1) ;
+
+if (!NewPtr)
+ {
+ printf("ERROR - No more memory\n") ;
+// werror(E_OUT_OF_MEM,__FILE__,Size);
+ exit (1);
+ }
+
+return NewPtr ;
+}
+/*
+-------------------------------------------------------------------------------
+Safe_malloc - Allocate a block of memory from the application heap
+and checking for out of memory errors.
+
+-------------------------------------------------------------------------------
+*/
+
+void *Safe_malloc(size_t Size)
+
+{
+void *NewPtr ;
+
+NewPtr = malloc(Size) ;
+
+if (!NewPtr)
+ {
+ printf("ERROR - No more memory\n") ;
+// werror(E_OUT_OF_MEM,__FILE__,Size);
+ exit (1);
+ }
+
+return NewPtr ;
+}
--- /dev/null
+/*
+===============================================================================
+SDCCERR - SDCC Standard error handler
+
+
+===============================================================================
+*/
+
+#if !defined(__SDCCERR_H)
+
+#define __SDCCERR_H
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* ERROR MEssage Definition */
+
+#define E_DUPLICATE 0 /* Duplicate variable */
+#define E_SYNTAX_ERROR 1 /* Syntax Error */
+#define E_CONST_EXPECTED 2 /* constant expected */
+#define E_OUT_OF_MEM 3 /* malloc failed */
+#define E_FILE_OPEN_ERR 4 /* File open failed */
+#define E_INVALID_OCLASS 5 /* output class invalid */
+#define E_CANNOT_ALLOC 6 /* cannot allocate space*/
+#define E_OLD_STYLE 7 /* old style C ! allowed*/
+#define E_STACK_OUT 8 /* v r out of stack */
+#define E_INTERNAL_ERROR 9 /* unable to alloc tvar */
+#define E_LVALUE_REQUIRED 10 /* lvalue required */
+#define E_TMPFILE_FAILED 11 /* tmpfile creation failed */
+#define E_FUNCTION_EXPECTED 12 /* function expected */
+#define E_USING_ERROR 13 /* using in error */
+#define E_SFR_INIT 14 /* init error for sbit */
+#define E_INIT_IGNORED 15 /* initialiser ignored */
+#define E_AUTO_ASSUMED 16 /* sclass auto assumed */
+#define E_AUTO_ABSA 17 /* abs addr for auto var*/
+#define E_INIT_WRONG 18 /* initializer type != */
+#define E_FUNC_REDEF 19 /* func name redefined */
+#define E_ID_UNDEF 20 /* identifer undefined */
+#define W_STACK_OVERFLOW 21 /* stack overflow */
+#define E_NEED_ARRAY_PTR 22 /* array or pointer reqd*/
+#define E_IDX_NOT_INT 23 /* index not an integer */
+#define E_ARRAY_BOUND 24 /* array limit exceeded */
+#define E_STRUCT_UNION 25 /* struct,union expected*/
+#define E_NOT_MEMBER 26 /* !struct/union member */
+#define E_PTR_REQD 27 /* pointer required */
+#define E_UNARY_OP 28 /* unary operator bad op*/
+#define E_CONV_ERR 29 /* conversion error */
+#define E_INT_REQD 30 /* bit field must be int*/
+#define E_BITFLD_SIZE 31 /* bit field size > 16 */
+#define E_TRUNCATION 32 /* high order trucation */
+#define E_CODE_WRITE 33 /* trying 2 write to code */
+#define E_LVALUE_CONST 34 /* lvalue is a const */
+#define E_ILLEGAL_ADDR 35 /* address of bit */
+#define E_CAST_ILLEGAL 36 /* cast illegal */
+#define E_MULT_INTEGRAL 37 /* mult opernd must b integral */
+#define E_ARG_ERROR 38 /* argument count error*/
+#define E_ARG_COUNT 39 /* func expecting more */
+#define E_FUNC_EXPECTED 40 /* func name expected */
+#define E_PLUS_INVALID 41 /* plus invalid */
+#define E_PTR_PLUS_PTR 42 /* pointer + pointer */
+#define E_SHIFT_OP_INVALID 43 /* shft op op invalid */
+#define E_COMPARE_OP 44 /* compare operand */
+#define E_BITWISE_OP 45 /* bit op invalid op */
+#define E_ANDOR_OP 46 /* && || op invalid */
+#define E_TYPE_MISMATCH 47 /* type mismatch */
+#define E_AGGR_ASSIGN 48 /* aggr assign */
+#define E_ARRAY_DIRECT 49 /* array indexing in */
+#define E_BIT_ARRAY 50 /* bit array not allowed */
+#define E_DUPLICATE_TYPEDEF 51 /* typedef name duplicate */
+#define E_ARG_TYPE 52 /* arg type mismatch */
+#define E_RET_VALUE 53 /* return value mismatch */
+#define E_FUNC_AGGR 54 /* function returing aggr */
+#define E_FUNC_DEF 55 /* ANSI Style def neede */
+#define E_DUPLICATE_LABEL 56 /* duplicate label name */
+#define E_LABEL_UNDEF 57 /* undefined label used */
+#define E_FUNC_VOID 58 /* void func ret value */
+#define E_VOID_FUNC 59 /* func must return value */
+#define E_RETURN_MISMATCH 60 /* return value mismatch */
+#define E_CASE_CONTEXT 61 /* case stmnt without switch */
+#define E_CASE_CONSTANT 62 /* case expression ! const*/
+#define E_BREAK_CONTEXT 63 /* break statement invalid*/
+#define E_SWITCH_AGGR 64 /* non integral for switch*/
+#define E_FUNC_BODY 65 /* func has body already */
+#define E_UNKNOWN_SIZE 66 /* variable has unknown size */
+#define E_AUTO_AGGR_INIT 67 /* auto aggregates no init */
+#define E_INIT_COUNT 68 /* too many initializers */
+#define E_INIT_STRUCT 69 /* struct init wrong */
+#define E_INIT_NON_ADDR 70 /* non address xpr for init */
+#define E_INT_DEFINED 71 /* interrupt already over */
+#define E_INT_ARGS 72 /* interrupt rtn cannot have args */
+#define E_INCLUDE_MISSING 73 /* compiler include missing */
+#define E_NO_MAIN 74 /* main function undefined */
+#define E_EXTERN_INIT 75 /* extern variable initialised */
+#define E_PRE_PROC_FAILED 76 /* preprocessor failed */
+#define E_DUP_FAILED 77 /* file DUP failed */
+#define E_INCOMPAT_CAST 78 /* incompatible pointer casting */
+#define E_LOOP_ELIMINATE 79 /* loop eliminated */
+#define W_NO_SIDE_EFFECTS 80 /* expression has no side effects */
+#define E_CONST_TOO_LARGE 81 /* constant out of range */
+#define W_BAD_COMPARE 82 /* bad comparison */
+#define E_TERMINATING 83 /* compiler terminating */
+#define W_LOCAL_NOINIT 84 /* local reference before assignment */
+#define W_NO_REFERENCE 85 /* no reference to local variable */
+#define E_OP_UNKNOWN_SIZE 86 /* unknown size for operand */
+#define W_LONG_UNSUPPORTED 87 /* 'long' not supported yet */
+#define W_LITERAL_GENERIC 88 /* literal being cast to generic pointer */
+#define E_SFR_ADDR_RANGE 89 /* sfr address out of range */
+#define E_BITVAR_STORAGE 90 /* storage given for 'bit' variable */
+#define W_EXTERN_MISMATCH 91 /* extern declaration mismatches */
+#define E_NONRENT_ARGS 92 /* fptr non reentrant has args */
+#define W_DOUBLE_UNSUPPORTED 93 /* 'double' not supported yet */
+#define W_IF_NEVER_TRUE 94 /* if always false */
+#define W_FUNC_NO_RETURN 95 /* no return statement found */
+#define W_PRE_PROC_WARNING 96 /* preprocessor generated warning */
+#define W_STRUCT_AS_ARG 97 /* structure passed as argument */
+#define E_PREV_DEF_CONFLICT 98 /* previous definition conflicts with current */
+#define E_CODE_NO_INIT 99 /* vars in code space must have initializer */
+#define E_OPS_INTEGRAL 100 /* operans must be integral for certian assignments */
+#define E_TOO_MANY_PARMS 101 /* too many parameters */
+#define E_TO_FEW_PARMS 102 /* to few parameters */
+#define E_FUNC_NO_CODE 103 /* fatalError */
+#define E_TYPE_MISMATCH_PARM 104 /* type mismatch for parameter */
+#define E_INVALID_FLOAT_CONST 105 /* invalid floating point literal string */
+#define E_INVALID_OP 106 /* invalid operand for some operation */
+#define E_SWITCH_NON_INTEGER 107 /* switch value not integer */
+#define E_CASE_NON_INTEGER 108 /* case value not integer */
+#define E_FUNC_TOO_LARGE 109 /* function too large */
+#define W_CONTROL_FLOW 110 /* control flow changed due to optimization */
+#define W_PTR_TYPE_INVALID 111 /* invalid type specifier for pointer */
+#define W_IMPLICIT_FUNC 112 /* function declared implicitly */
+#define E_CONTINUE 113 /* more than one line */
+#define W_TOOMANY_SPILS 114 /* too many spils occured */
+#define W_UNKNOWN_PRAGMA 115 /* #pragma directive unsupported */
+#define W_SHIFT_CHANGED 116 /* shift changed to zero */
+#define W_UNKNOWN_OPTION 117 /* don't know the option */
+#define W_UNSUPP_OPTION 118 /* processor reset has been redifned */
+#define W_UNKNOWN_FEXT 119 /* unknown file extension */
+#define W_TOO_MANY_SRC 120 /* can only compile one .c file at a time */
+#define I_CYCLOMATIC 121 /* information message */
+#define E_DIVIDE_BY_ZERO 122 /* / 0 */
+#define E_FUNC_BIT 123 /* function cannot return bit */
+#define E_CAST_ZERO 124 /* casting to from size zero */
+#define W_CONST_RANGE 125 /* constant too large */
+#define W_CODE_UNREACH 126 /* unreachable code */
+#define W_NONPTR2_GENPTR 127 /* non pointer cast to generic pointer */
+#define W_POSSBUG 128 /* possible code generation error */
+#define W_PTR_ASSIGN 129 /* incampatible pointer assignment */
+#define W_UNKNOWN_MODEL 130 /* Unknown memory model */
+#define E_UNKNOWN_TARGET 131 /* target not defined */
+#define W_INDIR_BANKED 132 /* Indirect call to a banked fun */
+#define W_UNSUPPORTED_MODEL 133 /* Unsupported model, ignored */
+#define W_BANKED_WITH_NONBANKED 134 /* banked and nonbanked attributes mixed */
+#define W_BANKED_WITH_STATIC 135 /* banked and static mixed */
+#define W_INT_TO_GEN_PTR_CAST 136 /* Converting integer type to generic pointer. */
+
+/*
+-------------------------------------------------------------------------------
+SetErrorOut - Set the error output file
+
+-------------------------------------------------------------------------------
+*/
+
+FILE * SetErrorOut(FILE *NewErrorOut) ;
+
+/*
+-------------------------------------------------------------------------------
+vwerror - Output a standard eror message with variable number of arguements
+
+-------------------------------------------------------------------------------
+*/
+
+void vwerror (int errNum, va_list marker) ;
+
+/*
+-------------------------------------------------------------------------------
+werror - Output a standard eror message with variable number of arguements
+
+-------------------------------------------------------------------------------
+*/
+
+void werror (int errNum, ... ) ;
+
+#endif
--- /dev/null
+/*
+===============================================================================
+NEWALLOC - SDCC Memory allocation functions
+
+These functions are wrappers for the standard malloc, realloc and free
+functions.
+
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them. Help stamp out software-hoarding!
+
+===============================================================================
+*/
+
+#if !defined(_NewAlloc_H)
+
+#define _NewAlloc_H
+
+#include <memory.h>
+
+/*
+-------------------------------------------------------------------------------
+Clear_realloc - Reallocate a memory block and clear any memory added with
+out of memory error detection
+
+-------------------------------------------------------------------------------
+*/
+
+void *Clear_realloc(void *OldPtr,size_t OldSize,size_t NewSize) ;
+
+/*
+-------------------------------------------------------------------------------
+Safe_realloc - Reallocate a memory block with out of memory error detection
+
+-------------------------------------------------------------------------------
+*/
+
+void *Safe_realloc(void *OldPtr,size_t NewSize) ;
+
+/*
+-------------------------------------------------------------------------------
+Safe_calloc - Allocate a block of memory from the application heap, clearing
+all data to zero and checking for out or memory errors.
+
+-------------------------------------------------------------------------------
+*/
+
+void *Safe_calloc(size_t Size) ;
+
+/*
+-------------------------------------------------------------------------------
+Safe_malloc - Allocate a block of memory from the application heap
+and checking for out or memory errors.
+
+-------------------------------------------------------------------------------
+*/
+
+void *Safe_malloc(size_t Size) ;
+
+#endif
--- /dev/null
+/*
+===============================================================================
+ERROR - Standard error handler
+
+
+===============================================================================
+*/
+
+#include <stdio.h>
+
+#include "sdccerr.h"
+
+#define USE_STDOUT_FOR_ERRORS 0
+
+#if USE_STDOUT_FOR_ERRORS
+
+static FILE *ErrorOut = stdout ;
+
+#else
+
+static FILE *ErrorOut = stderr ;
+
+#endif
+
+#define ERROR 0
+#define WARNING 1
+
+extern char *filename ;
+extern int lineno ;
+extern int fatalError ;
+
+struct {
+ int errType ;
+ char *errText ;
+} ErrTab [] =
+{
+{ ERROR ,"error *** Duplicate symbol '%s', symbol IGNORED\n" },
+{ ERROR ,"error *** Syntax Error Declaration ingonerd\n" },
+{ ERROR ,"error *** Constant Expected Found Variable\n" },
+{ ERROR ,"error *** 'malloc' failed file '%s' for size %ld\n" },
+{ ERROR ,"error *** 'fopen' failed on file '%s'\n" },
+{ ERROR ,"error *** Internal Error Oclass invalid '%s'\n" },
+{ ERROR ,"error *** Cannot allocate variable '%s'.\n" },
+{ ERROR ,"error *** Old style C declaration. IGNORED '%s'\n" },
+{ ERROR ,"error *** Out of stack Space. '%s' not allocted\n" },
+{ ERROR ,"error *** FATAL Compiler Internal Error in file '%s' line number '%d' : %s \nContact Author with source code\n" },
+{ ERROR ,"error *** 'lvalue' required for '%s' operation .\n" },
+{ ERROR ,"error *** Creation of temp file failed\n" },
+{ ERROR ,"error *** Function expected here '%s'\n" },
+{ ERROR ,"error *** 'using', 'interrupt' or 'reentrant' must follow a function definiton .'%s'\n"},
+{ ERROR ,"error *** Absolute address & initial value both cannot be specified for\n a 'sfr','sbit' storage class, initial value ignored '%s'\n" },
+{ WARNING,"warning *** Variable in the storage class cannot be initialized.'%s'\n"},
+{ WARNING,"warning *** storage class not allowed for automatic variable '%s' in reentrant function\n" },
+{ ERROR ,"error *** absolute address not allowed for automatic var '%s' in reentrant function \n" },
+{ WARNING,"warning *** Initializer different levels of indirections\n" },
+{ ERROR ,"error *** Function name '%s' redefined \n" },
+{ ERROR ,"error *** Undefined identifier '%s'\n" },
+{ WARNING,"warning *** stack exceeds 256 bytes for function '%s'\n"},
+{ ERROR ,"error *** Array or pointer required for '%s' operation \n" },
+{ ERROR ,"error *** Array index not an integer\n" },
+{ ERROR ,"error *** Array bound Exceeded, assuming zero\n" },
+{ ERROR ,"error *** Structure/Union expected left of '.%s'\n" },
+{ ERROR ,"error *** '%s' not a structure/union member\n" },
+{ ERROR ,"error *** Pointer required\n" },
+{ ERROR ,"error *** 'unary %c': illegal operand\n" },
+{ ERROR ,"error *** convertion error: integral promotion failed\n" },
+{ ERROR ,"error *** type must be INT for bit field definition\n" },
+{ ERROR ,"error *** bit field size greater than 16 . assuming 16\n" },
+{ WARNING,"warning *** high order truncation might occur\n" },
+{ ERROR ,"error *** Attempt to assign value to a constant variable %s\n" },
+{ ERROR ,"error *** Lvalue specifies constant object\n" },
+{ ERROR ,"error *** '&' illegal operand , %s\n" },
+{ ERROR ,"error *** illegal cast (cast cannot be aggregate)\n" },
+{ ERROR ,"error *** '*' bad operand\n" },
+{ ERROR ,"error *** Argument count error, argument ignored\n" },
+{ ERROR ,"error *** Function was expecting more arguments\n" },
+{ ERROR ,"error *** Function name expected '%s'.ANSI style declaration REQUIRED\n"},
+{ ERROR ,"error *** invalid operand '%s'\n" },
+{ ERROR ,"error *** pointer + pointer invalid\n" },
+{ ERROR ,"error *** invalid operand for shift operator\n" },
+{ ERROR ,"error *** compare operand cannot be struct/union\n" },
+{ ERROR ,"error *** operand invalid for bitwise operation\n" },
+{ ERROR ,"error *** Invalid operand for '&&' or '||'\n" },
+{ WARNING,"warning *** indirections to different types %s %s \n" },
+{ ERROR ,"error *** cannot assign values to aggregates\n" },
+{ ERROR ,"error *** bit Arrays can be accessed by literal index only\n" },
+{ ERROR ,"error *** Array or Pointer to bit|sbit|sfr not allowed.'%s'\n" },
+{ ERROR ,"error *** typedef/enum '%s' duplicate.Previous definiton Ignored\n" },
+{ ERROR ,"error *** Actual Argument type different from declaration %d\n" },
+{ ERROR ,"error *** Function return value mismatch\n" },
+{ ERROR ,"error *** Function cannot return aggregate. Func body ignored\n" },
+{ ERROR ,"error *** ANSI Style declaration needed\n" },
+{ ERROR ,"error *** Label name redefined '%s'\n" },
+{ ERROR ,"error *** Label undefined '%s'\n" },
+{ ERROR ,"error *** void function returning value\n" },
+{ ERROR ,"error *** function '%s' must return value\n" },
+{ WARNING,"warning *** function return value mismatch\n" },
+{ ERROR ,"error *** 'case/default' found without 'switch'.statement ignored\n" },
+{ ERROR ,"error *** 'case' expression not constant. statement ignored\n" },
+{ ERROR ,"error *** 'break/continue' statement out of context\n" },
+{ ERROR ,"error *** nonintegral used in switch expression\n" },
+{ ERROR ,"error *** function '%s' already has body\n" },
+{ ERROR ,"error *** attempt to allocate variable of unknown size '%s'\n" },
+{ ERROR ,"error *** aggregate 'auto' variable '%s' cannot be initialized\n" },
+{ ERROR ,"error *** too many initializers\n" },
+{ ERROR ,"error *** struct/union/array '%s' :initialization needs curly braces\n"},
+{ ERROR ,"error *** non-address initialization expression\n" },
+{ ERROR ,"error *** interrupt no '%d' already has a service routine '%s'\n" },
+{ ERROR ,"error *** interrupt routine cannot have arguments, arguments ingored\n"},
+{ ERROR ,"error *** critical compiler #include file missing. \n" },
+{ ERROR ,"error *** function 'main' undefined\n" },
+{ ERROR ,"error *** 'extern' variable '%s' cannot be initialised \n" },
+{ ERROR ,"error *** Pre-Processor %s\n" },
+{ ERROR ,"error *** _dup call failed\n" },
+{ WARNING,"warning *** pointer being cast to incompatible type \n" },
+{ WARNING,"warning *** 'while' loop with 'zero' constant.loop eliminated\n" },
+{ WARNING,"warning *** %s expression has NO side effects.expr eliminated\n" },
+{ WARNING,"warning *** constant value '%s', out of range.\n" },
+{ WARNING,"warning *** comparison will either, ALWAYs succeed or ALWAYs fail\n" },
+{ ERROR ,"error *** Compiler Terminating , contact author with source\n" },
+{ WARNING,"warning *** 'auto' variable '%s' may be used before initialization at %s(%d)\n" },
+{ WARNING,"warning *** in function %s unreferenced %s : '%s'\n" },
+{ ERROR ,"error *** unknown size for operand\n" },
+{ WARNING,"warning *** '%s' 'long' not supported , declared as 'int' .\n" },
+{ WARNING,"warning *** LITERAL value being cast to '_generic' pointer\n" },
+{ ERROR ,"error *** %s '%s' address out of range\n" },
+{ ERROR ,"error *** storage class CANNOT be specified for bit variable '%s'\n" },
+{ WARNING,"warning *** extern definition for '%s' mismatches with declaration.\n" },
+{ WARNING,"warning *** Functions called via pointers must be 'reentrant' to take arguments\n" },
+{ WARNING,"warning *** type 'double' not supported assuming 'float'\n" },
+{ WARNING,"warning *** if-statement condition always false.if-statement not generated\n"},
+{ WARNING,"warning *** no 'return' statement found for function '%s'\n" },
+{ WARNING,"warning *** Pre-Processor %s\n" },
+{ WARNING,"warning *** structure '%s' passed as function argument changed to pointer\n"},
+{ ERROR ,"error *** conflict with previous definition of '%s' for attribute '%s'\n" },
+{ ERROR ,"error *** variable '%s' declared in code space must have initialiser\n" },
+{ ERROR ,"error *** operands not integral for assignment operation\n" },
+{ ERROR ,"error *** too many parameters \n" },
+{ ERROR ,"error *** to few parameters\n" },
+{ ERROR ,"error *** code not generated for '%s' due to previous errors\n"},
+{ WARNING,"warning *** type mismatch for parameter number %d\n"},
+{ ERROR ,"error *** invalid float constant '%s'\n"},
+{ ERROR ,"error *** invalid operand for '%s' operation\n"},
+{ ERROR ,"error *** switch value not an integer\n"},
+{ ERROR ,"error *** case label not an integer\n"},
+{ WARNING,"warning *** function '%s' too large for global optimization\n"},
+{ WARNING,"warning *** conditional flow changed by optimizer '%s(%d)':so said EVELYN the modified DOG\n"},
+{ WARNING,"warning *** invalid type specifier for pointer type specifier ignored\n"},
+{ WARNING,"warning *** function '%s' implicit declaration\n"},
+{ WARNING,"warning *** %s"},
+{ WARNING,"info *** %s extended by %d bytes for compiler temp(s) :in function '%s': %s \n"},
+{ WARNING,"warning *** unknown or unsupported #pragma directive '%s'\n"},
+{ WARNING,"warning *** %s shifting more than size of object changed to zero\n"},
+{ WARNING,"warning *** unknown compiler option '%s' ignored\n"},
+{ WARNING,"warning *** option '%s' no longer supported '%s' \n"},
+{ WARNING,"warning *** don't know what to do with file '%s'. file extension unsupported\n"},
+{ WARNING,"warning *** cannot compile more than one source file . file '%s' ignored\n"},
+{ WARNING,"info *** function '%s', # edges %d , # nodes %d , cyclomatic complexity %d\n"},
+{ ERROR ,"error *** dividing by ZERO\n"},
+{ ERROR ,"error *** function cannot return 'bit'\n"},
+{ ERROR ,"error *** casting from to type 'void' is illegal\n"},
+{ WARNING,"warning *** constant is out of range %s\n" },
+{ WARNING,"warning *** unreachable code %s(%d)\n"},
+{ WARNING,"warning *** non-pointer type cast to _generic pointer\n"},
+{ WARNING,"warning *** possible code generation error at line %d,\n send source to sandeep.dutta@usa.net\n"},
+{ WARNING,"warning *** pointer types incompatible \n" },
+{ WARNING,"warning *** unknown memory model at %s : %d\n" },
+{ ERROR ,"error *** cannot generate code for target '%s'\n"},
+{ WARNING,"warning *** Indirect call to a banked function not implemented.\n"},
+{ WARNING,"warning *** Model '%s' not supported for %s, ignored.\n"},
+{ WARNING,"warning *** Both banked and nonbanked attributes used. nonbanked wins.\n"},
+{ WARNING,"warning *** Both banked and static used. static wins.\n"},
+{ WARNING,"warning *** converting integer type to generic pointer: assuming XDATA\n"}
+};
+/*
+-------------------------------------------------------------------------------
+SetErrorOut - Set the error output file
+
+-------------------------------------------------------------------------------
+*/
+
+FILE *SetErrorOut(FILE *NewErrorOut)
+
+{
+ErrorOut = NewErrorOut ;
+
+return NewErrorOut ;
+}
+/*
+-------------------------------------------------------------------------------
+vwerror - Output a standard eror message with variable number of arguements
+
+-------------------------------------------------------------------------------
+*/
+
+void vwerror (int errNum, va_list marker)
+
+{
+if ( ErrTab[errNum].errType == ERROR )
+ fatalError++ ;
+
+if ( filename && lineno )
+ fprintf(ErrorOut, "%s(%d):",filename,lineno);
+
+vfprintf(ErrorOut, ErrTab[errNum].errText,marker);
+}
+/*
+-------------------------------------------------------------------------------
+werror - Output a standard eror message with variable number of arguements
+
+-------------------------------------------------------------------------------
+*/
+
+void werror (int errNum, ... )
+
+{
+va_list marker;
+va_start(marker,errNum);
+vwerror(errNum, marker);
+va_end( marker );
+}
+
#include <stdlib.h>
#include "i386/i386.h"
#include "i386/xm-i386.h"
+#define alloca Safe_calloc
#define bcopy(s, d, n) memcpy(d, s, n)
#define bcmp memcmp
#define bzero(p, l) memset(p, 0, l)
#include "i386/xm-linux.h"
#ifndef __BORLANDC__
-#define alloca malloc
+#define alloca Safe_calloc
#else
#include <string.h>
#include <stdlib.h>
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding! */
-#include "config.h"
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
-static void
-memory_full ()
-{
- perror ("Memory exhausted.");
-}
-
-char *xmalloc ( unsigned size)
-{
- register char *ptr = (char *) malloc (size);
- if (ptr != 0) return (ptr);
- memory_full ();
- /*NOTREACHED*/
- return 0;
-}
-
-char *xrealloc (
- char *old,
- unsigned size )
-{
- register char *ptr = (char *) realloc (old, size);
- if (ptr == 0)
- memory_full ();
- return ptr;
-}
-
-char *xcalloc (
- unsigned number, unsigned size)
-{
- register unsigned total = number * size;
- register char *ptr = (char *) calloc (number, size);
- if (ptr == 0)
- memory_full ();
- return ptr;
-}
+// #include "config.h"
+// #ifdef HAVE_MALLOC_H
+// #include <malloc.h>
+// #endif
+//
+// static void
+// memory_full ()
+// {
+// perror ("Memory exhausted.");
+//}
+//
+// char *xmalloc ( unsigned size)
+// {
+// register char *ptr = (char *) malloc (size);
+// if (ptr != 0) return (ptr);
+// memory_full ();
+ /*NOTREACHED*/
+// return 0;
+// }
+//
+// char *xrealloc (
+// char *old,
+// unsigned size )
+// {
+// register char *ptr = (char *) realloc (old, size);
+// if (ptr == 0)
+// memory_full ();
+// return ptr;
+// }
+//
+// char *xcalloc (
+// unsigned number, unsigned size)
+// {
+// register unsigned total = number * size;
+// register char *ptr = (char *) calloc (number, size);
+// if (ptr == 0)
+// memory_full ();
+// return ptr;
+// }
/* Parse a C expression from text in a string */
-#if defined(_MSC_VER)
-#include <malloc.h>
-#endif
+//#if defined(_MSC_VER)
+//#include <malloc.h>
+//#endif
#include "config.h"
#include "cpplib.h"
-extern char *xmalloc PARAMS ((unsigned));
-extern char *xrealloc PARAMS ((char *, unsigned));
+#include "newalloc.h"
+
+//extern char *xmalloc PARAMS ((unsigned));
+//extern char *xrealloc PARAMS ((char *, unsigned));
#ifdef MULTIBYTE_CHARS
#include <stdlib.h>
#define NULL_PTR ((GENERIC_PTR)0)
#endif
-extern char *xmalloc ();
+//extern char *xmalloc ();
#ifndef CHAR_TYPE_SIZE
#define CHAR_TYPE_SIZE BITS_PER_UNIT
int old_size = (char*)limit - (char*)stack;
int new_size = 2 * old_size;
if (stack != init_stack)
- new_stack = (struct operation*) xrealloc (stack, new_size);
+ new_stack = (struct operation*) Safe_realloc (stack, new_size);
else
{
- new_stack = (struct operation*) xmalloc (new_size);
+ new_stack = (struct operation*) Safe_malloc (new_size);
bcopy ((char *) stack, (char *) new_stack, old_size);
}
stack = new_stack;
#include "cpplib.h"
#include "cpphash.h"
-extern char *xmalloc PARAMS ((unsigned));
+//extern char *xmalloc PARAMS ((unsigned));
+
+#include "newalloc.h"
+
+#if defined(_MSC_VER)
+#include <string.h>
+#include <stdlib.h>
+#endif
/* Define a generic NULL if one hasn't already been defined. */
hash = hashf (name, len, HASHSIZE);
i = sizeof (HASHNODE) + len + 1;
- hp = (HASHNODE *) xmalloc (i);
+ hp = (HASHNODE *) Safe_malloc (i);
bucket = hash;
hp->bucket_hdr = &hashtab[bucket];
hp->next = hashtab[bucket];
for the sake of machines with limited C compilers. */
#ifndef EMACS
#include "config.h"
-#include <malloc.h>
+#include "newalloc.h"
#include <string.h>
#endif /* not EMACS */
#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
/* Forward declarations. */
-extern char *xmalloc ();
+//extern char *Safe_malloc ();
static void add_import ();
static void append_include_chain ();
static void push_macro_expansion PARAMS ((cpp_reader *,
U_CHAR*, int, HASHNODE*));
static struct cpp_pending *nreverse_pending PARAMS ((struct cpp_pending*));
-extern char *xrealloc ();
-extern char *xcalloc ();
+//extern char *xrealloc ();
+//extern char *xcalloc ();
static char *savestring ();
static void conditional_skip ();
{
long old_written = CPP_WRITTEN (pfile);
pfile->token_buffer_size = n + 2 * pfile->token_buffer_size;
- pfile->token_buffer = (U_CHAR*)
- xrealloc(pfile->token_buffer, pfile->token_buffer_size);
+ pfile->token_buffer = (U_CHAR*) Safe_realloc(pfile->token_buffer, pfile->token_buffer_size);
CPP_SET_WRITTEN (pfile, old_written);
}
if (pfile->deps_size + size + 8 > pfile->deps_allocated_size)
{
pfile->deps_allocated_size = (pfile->deps_size + size + 50) * 2;
- pfile->deps_buffer = (char *) xrealloc (pfile->deps_buffer,
+ pfile->deps_buffer = (char *) Safe_realloc(pfile->deps_buffer,
pfile->deps_allocated_size);
}
if (spacer == ' ' && pfile->deps_column > 0)
while (*q != 0 && *q != PATH_SEPARATOR) q++;
if (p == q) {
/* An empty name in the path stands for the current directory. */
- name = (char *) xmalloc (2);
+ name = (char *) Safe_malloc (2);
name[0] = '.';
name[1] = 0;
} else {
/* Otherwise use the directory that is named. */
- name = (char *) xmalloc (q - p + 1);
+ name = (char *) Safe_malloc (q - p + 1);
bcopy (p, name, q - p);
name[q - p] = 0;
}
dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ Safe_malloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
dirtmp->c_system_include_path = 0;
while (p < limit)
if (*p++ == '@')
maxsize++;
- defn = (DEFINITION *) xcalloc (1, maxsize);
+ defn = (DEFINITION *) Safe_calloc(maxsize);
defn->nargs = nargs;
exp_p = defn->expansion = (U_CHAR *) defn + sizeof (DEFINITION);
break;
/* make a pat node for this arg and append it to the end of
the pat list */
- tpat = (struct reflist *) xmalloc (sizeof (struct reflist));
+ tpat = (struct reflist *) Safe_malloc (sizeof (struct reflist));
tpat->next = NULL;
tpat->raw_before = concat == id_beg;
tpat->raw_after = 0;
#if 0
/* This isn't worth the time it takes. */
/* give back excess storage */
- defn->expansion = (U_CHAR *) xrealloc (defn->expansion, defn->length + 1);
+ defn->expansion = (U_CHAR *) Safe_realloc(defn->expansion, defn->length + 1);
#endif
return defn;
/* Now set defn->args.argnames to the result of concatenating
the argument names in reverse order
with comma-space between them. */
- defn->args.argnames = (U_CHAR *) xmalloc (arglengths + 1);
+ defn->args.argnames = (U_CHAR *) Safe_malloc (arglengths + 1);
{
struct arglist *temp;
int i = 0;
bzero ((char *) buf, sizeof (cpp_buffer));
CPP_BUFFER (pfile) = buf;
#else
- register cpp_buffer *buf = (cpp_buffer*) xmalloc (sizeof(cpp_buffer));
+ register cpp_buffer *buf = (cpp_buffer*) Safe_malloc (sizeof(cpp_buffer));
bzero ((char *) buf, sizeof (cpp_buffer));
CPP_PREV_BUFFER (buf) = CPP_BUFFER (pfile);
CPP_BUFFER (pfile) = buf;
args[ap->argno].use_count++;
}
- xbuf = (U_CHAR *) xmalloc (xbuf_len + 1);
+ xbuf = (U_CHAR *) Safe_malloc (xbuf_len + 1);
/* Generate in XBUF the complete expansion
with arguments substituted in.
/* Allocate this permanently, because it gets stored in the definitions
of macros. */
- fname = (char *) xmalloc (pfile->max_include_len + flen + 4);
+ fname = (char *) Safe_malloc (pfile->max_include_len + flen + 4);
/* + 2 above for slash and terminating null. */
/* + 2 added for '.h' on VMS (to support '#include filename') */
/* This is the first time for this file. */
/* Add it to list of files included. */
- ptr = (struct file_name_list *) xmalloc (sizeof (struct file_name_list));
+ ptr = (struct file_name_list *) Safe_malloc (sizeof (struct file_name_list));
ptr->control_macro = 0;
ptr->c_system_include_path = 0;
ptr->next = pfile->all_include_files;
register U_CHAR *p, *q;
i = sizeof (ASSERTION_HASHNODE) + len + 1;
- hp = (ASSERTION_HASHNODE *) xmalloc (i);
+ hp = (ASSERTION_HASHNODE *) Safe_malloc (i);
bucket = hash;
hp->bucket_hdr = &pfile->assertion_hashtab[bucket];
hp->next = pfile->assertion_hashtab[bucket];
}
if (hp == 0) {
/* Didn't find it; cons up a new one. */
- hp = (HASHNODE *) xcalloc (1, sizeof (HASHNODE) + fname_length + 1);
+ hp = (HASHNODE *) Safe_calloc(sizeof (HASHNODE) + fname_length + 1);
hp->next = *hash_bucket;
*hash_bucket = hp;
U_CHAR *buf,U_CHAR *limit)
{
int length = limit - buf;
- U_CHAR *copy = (U_CHAR *) xmalloc (length + 1);
+ U_CHAR *copy = (U_CHAR *) Safe_malloc (length + 1);
bcopy (buf, copy, length);
copy[length] = 0;
SKIP_WHITE_SPACE (copy);
U_CHAR *buf,U_CHAR *limit)
{
int length = limit - buf;
- U_CHAR *copy = (U_CHAR *) xmalloc (length + 1);
+ U_CHAR *copy = (U_CHAR *) Safe_malloc (length + 1);
bcopy (buf, copy, length);
copy[length] = 0;
SKIP_WHITE_SPACE (copy);
}
- new = (struct file_name_list *) xmalloc (sizeof (struct file_name_list));
+ new = (struct file_name_list *) Safe_malloc (sizeof (struct file_name_list));
new->next = pfile->dont_repeat_files;
pfile->dont_repeat_files = new;
new->fname = savestring (ip->fname);
skip = (hp == NULL) ^ (keyword->type == T_IFNDEF);
if (start_of_file && !skip)
{
- control_macro = (U_CHAR *) xmalloc (ident_length + 1);
+ control_macro = (U_CHAR *) Safe_malloc (ident_length + 1);
bcopy (ident, control_macro, ident_length + 1);
}
}
{
IF_STACK_FRAME *temp;
- temp = (IF_STACK_FRAME *) xcalloc (1, sizeof (IF_STACK_FRAME));
+ temp = (IF_STACK_FRAME *) Safe_calloc(sizeof (IF_STACK_FRAME));
temp->fname = CPP_BUFFER (pfile)->nominal_fname;
#if 0
temp->lineno = CPP_BUFFER (pfile)->lineno;
case T_IFDEF:
case T_IFNDEF:
temp
- = (IF_STACK_FRAME *) xcalloc (1, sizeof (IF_STACK_FRAME));
+ = (IF_STACK_FRAME *) Safe_calloc(sizeof (IF_STACK_FRAME));
temp->next = pfile->if_stack;
pfile->if_stack = temp;
#if 0
CPP_SET_WRITTEN (pfile, before_name_written);
special_symbol (hp, pfile);
xbuf_len = CPP_WRITTEN (pfile) - before_name_written;
- xbuf = (U_CHAR *) xmalloc (xbuf_len + 1);
+ xbuf = (U_CHAR *) Safe_malloc (xbuf_len + 1);
CPP_SET_WRITTEN (pfile, before_name_written);
bcopy (CPP_PWRITTEN (pfile), xbuf, xbuf_len + 1);
push_macro_expansion (pfile, xbuf, xbuf_len, hp);
hashval = import_hash (fname);
fstat (fd, &sb);
- i = (struct import_file *)xmalloc (sizeof (struct import_file));
- i->name = (char *)xmalloc (strlen (fname)+1);
+ i = (struct import_file *)Safe_malloc (sizeof (struct import_file));
+ i->name = (char *)Safe_malloc (strlen (fname)+1);
strcpy (i->name, fname);
bcopy ((char *) &sb.st_ino, (char *) &i->inode, sizeof (sb.st_ino));
i->dev = sb.st_dev;
int len;
len = 20;
- set = alloc = xmalloc (len + 1);
+ set = alloc = Safe_malloc (len + 1);
if (! is_space[ch])
{
*set++ = ch;
if (set - alloc == len)
{
len *= 2;
- alloc = xrealloc (alloc, len + 1);
+ alloc = Safe_realloc(alloc, len + 1);
set = alloc + len / 2;
}
*set++ = ch;
return map_list_ptr->map_list_map;
map_list_ptr = ((struct file_name_map_list *)
- xmalloc (sizeof (struct file_name_map_list)));
+ Safe_malloc (sizeof (struct file_name_map_list)));
map_list_ptr->map_list_name = savestring (dirname);
map_list_ptr->map_list_map = NULL;
to = read_filename_string (ch, f);
ptr = ((struct file_name_map *)
- xmalloc (sizeof (struct file_name_map)));
+ Safe_malloc (sizeof (struct file_name_map)));
ptr->map_from = from;
/* Make the real filename absolute. */
ptr->map_to = to;
else
{
- ptr->map_to = xmalloc (dirlen + strlen (to) + 2);
+ ptr->map_to = Safe_malloc (dirlen + strlen (to) + 2);
strcpy (ptr->map_to, dirname);
ptr->map_to[dirlen] = '/';
strcpy (ptr->map_to + dirlen + 1, to);
fp->cleanup = file_cleanup;
if (S_ISREG (st_mode)) {
- fp->buf = (U_CHAR *) xmalloc (st_size + 2);
+ fp->buf = (U_CHAR *) Safe_malloc (st_size + 2);
fp->alimit = fp->buf + st_size + 2;
fp->cur = fp->buf;
int bsize = 2000;
st_size = 0;
- fp->buf = (U_CHAR *) xmalloc (bsize + 2);
+ fp->buf = (U_CHAR *) Safe_malloc (bsize + 2);
for (;;) {
i = safe_read (f, fp->buf + st_size, bsize - st_size);
if (st_size != bsize)
break; /* End of file */
bsize *= 2;
- fp->buf = (U_CHAR *) xrealloc (fp->buf, bsize + 2);
+ fp->buf = (U_CHAR *) Safe_realloc(fp->buf, bsize + 2);
}
fp->cur = fp->buf;
length = st_size;
if (*startp == PATH_SEPARATOR)
num_dirs++;
include_defaults
- = (struct default_include *) xmalloc ((num_dirs
+ = (struct default_include *) Safe_malloc ((num_dirs
* sizeof (struct default_include))
+ sizeof (include_defaults_array));
startp = endp = epath;
if (!strncmp (p->fname, default_prefix, default_len)) {
/* Yes; change prefix and add to search list. */
struct file_name_list *new
- = (struct file_name_list *) xmalloc (sizeof (struct file_name_list));
+ = (struct file_name_list *) Safe_malloc (sizeof (struct file_name_list));
int this_len = strlen (specd_prefix) + strlen (p->fname) - default_len;
- char *str = (char *) xmalloc (this_len + 1);
+ char *str = (char *) Safe_malloc (this_len + 1);
strcpy (str, specd_prefix);
strcat (str, p->fname + default_len);
new->fname = str;
if (!p->cplusplus
|| (opts->cplusplus && !opts->no_standard_cplusplus_includes)) {
struct file_name_list *new
- = (struct file_name_list *) xmalloc (sizeof (struct file_name_list));
+ = (struct file_name_list *) Safe_malloc (sizeof (struct file_name_list));
new->control_macro = 0;
new->c_system_include_path = !p->cxx_aware;
new->fname = p->fname;
if (*s != 0)
{
opts->deps_target = s + 1;
- output_file = (char *) xmalloc (s - spec + 1);
+ output_file = (char *) Safe_malloc (s - spec + 1);
bcopy (spec, output_file, s - spec);
output_file[s - spec] = 0;
}
if (opts->print_deps)
{
pfile->deps_allocated_size = 200;
- pfile->deps_buffer = (char *) xmalloc (pfile->deps_allocated_size);
+ pfile->deps_buffer = (char *) Safe_malloc (pfile->deps_allocated_size);
pfile->deps_buffer[0] = 0;
pfile->deps_size = 0;
pfile->deps_column = 0;
pfile->get_token = cpp_get_token;
pfile->token_buffer_size = 200;
- pfile->token_buffer = (U_CHAR*)xmalloc (pfile->token_buffer_size);
+ pfile->token_buffer = (U_CHAR*)Safe_malloc (pfile->token_buffer_size);
CPP_SET_WRITTEN (pfile, 0);
pfile->system_include_depth = 0;
char *arg)
{
struct cpp_pending *pend
- = (struct cpp_pending*)xmalloc (sizeof (struct cpp_pending));
+ = (struct cpp_pending*)Safe_malloc (sizeof (struct cpp_pending));
pend->cmd = cmd;
pend->arg = arg;
pend->next = CPP_OPTIONS (pfile)->pending;
fatal ("Filename missing after `-isystem' option");
dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ Safe_malloc (sizeof (struct file_name_list));
dirtmp->next = 0;
dirtmp->control_macro = 0;
dirtmp->c_system_include_path = 1;
- dirtmp->fname = (char *) xmalloc (strlen (argv[i+1]) + 1);
+ dirtmp->fname = (char *) Safe_malloc (strlen (argv[i+1]) + 1);
strcpy (dirtmp->fname, argv[++i]);
dirtmp->got_name_map = 0;
}
dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ Safe_malloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
dirtmp->c_system_include_path = 0;
if (i + 1 == argc)
fatal ("Directory name missing after `-iwithprefix' option");
- dirtmp->fname = (char *) xmalloc (strlen (argv[i+1])
+ dirtmp->fname = (char *) Safe_malloc (strlen (argv[i+1])
+ strlen (prefix) + 1);
strcpy (dirtmp->fname, prefix);
strcat (dirtmp->fname, argv[++i]);
}
dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ Safe_malloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
dirtmp->c_system_include_path = 0;
if (i + 1 == argc)
fatal ("Directory name missing after `-iwithprefixbefore' option");
- dirtmp->fname = (char *) xmalloc (strlen (argv[i+1])
+ dirtmp->fname = (char *) Safe_malloc (strlen (argv[i+1])
+ strlen (prefix) + 1);
strcpy (dirtmp->fname, prefix);
strcat (dirtmp->fname, argv[++i]);
struct file_name_list *dirtmp;
dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ Safe_malloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
dirtmp->c_system_include_path = 0;
}
else {
dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ Safe_malloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
dirtmp->control_macro = 0;
dirtmp->c_system_include_path = 0;
U_CHAR *symname = pfile->token_buffer + symstart;
int hashcode = hashf (symname, sym_length, ASSERTION_HASHSIZE);
struct tokenlist_list *value
- = (struct tokenlist_list *) xmalloc (sizeof (struct tokenlist_list));
+ = (struct tokenlist_list *) Safe_malloc (sizeof (struct tokenlist_list));
hp = assertion_lookup (pfile, symname, sym_length, hashcode);
if (hp == NULL) {
length = CPP_WRITTEN (pfile) - name_written;
temp = (struct arglist *)
- xmalloc (sizeof (struct arglist) + length + 1);
+ Safe_malloc (sizeof (struct arglist) + length + 1);
temp->name = (U_CHAR *) (temp + 1);
bcopy ((char *) (pfile->token_buffer + name_written),
(char *) temp->name, length);
char *input)
{
unsigned size = strlen (input);
- char *output = xmalloc (size + 1);
+ char *output = Safe_malloc (size + 1);
strcpy (output, input);
return output;
}
if (ip != NULL)
cpp_file_line_for_message (pfile, ip->nominal_fname, ip->lineno, -1);
- cpp_message (pfile, 1, "%s: %s", name, my_strerror (errno));
+ cpp_message (pfile, 1, "%s: %s", name, my_strerror (errno),NULL);
}
void
extern cpp_hashnode* cpp_lookup PARAMS ((cpp_reader*, const U_CHAR*,
int, int));
+/* Define the MS VC6 stuff - Some of these should also be defined for
+the other hosts but they are here until declared safe for all */
+
+#if defined(_MSC_VER)
+
+void init_parse_file (cpp_reader *pfile) ;
+
+void init_parse_options (struct cpp_options *opts) ;
+
+int push_parse_file (cpp_reader *pfile,char *fname) ;
+
+void cpp_finish (cpp_reader *pfile) ;
+
+void cpp_hash_cleanup (cpp_reader *pfile) ;
+
+void cpp_file_line_for_message (cpp_reader *pfile,char *filename ,int line, int column) ;
+
+void cpp_print_containing_files (cpp_reader *pfile) ;
+
+void cpp_message (cpp_reader *pfile,int is_error,char *msg,char *arg1, char *arg2, char *arg3) ;
+
+void skip_rest_of_line (cpp_reader *pfile) ;
+
+/* Parse an identifier starting with C. */
+
+int parse_name (cpp_reader *pfile, int c) ;
+
+#endif
+
+
#ifdef __cplusplus
}
#endif
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /J /FD /c
+# ADD CPP /nologo /G3 /Zp1 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
# SUBTRACT CPP /WX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G3 /Zp1 /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /J /FD /GZ /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /G3 /Zp8 /ML /W3 /Gm /GX /ZI /Od /I "..\util" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"./" /J /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
+# ADD BSC32 /nologo /o".\sdcpp.bsc"
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"..\..\bin\sdcpp.exe" /pdbtype:sept
+# ADD LINK32 /nologo /version:2.2 /subsystem:console /debug /machine:I386 /out:"..\..\bin\sdcpp.exe" /pdbtype:sept
# SUBTRACT LINK32 /incremental:no
!ENDIF
SOURCE=cppmain.c
# End Source File
+# Begin Source File
+
+SOURCE=..\Util\NewAlloc.c
+# End Source File
# End Group
# Begin Group "Header Files"
# End Source File
# Begin Source File
+SOURCE=..\Util\newalloc.h
+# End Source File
+# Begin Source File
+
SOURCE=.\tm.h
# End Source File
# End Group