*** old\globals.h --- globals.h ************** *** 33,35 ! #if ATARTI_ST Global char *patharg Init(0); /* -p: path for finding iconx */ --- 33,35 ----- ! #if ATARI_ST Global char *patharg Init(0); /* -p: path for finding iconx */ ************** *** 38,39 Global int silent Init(0); /* -s: suppress info messages? */ Global int m4pre Init(0); /* -m: use m4 preprocessor? [UNIX] */ --- 38,40 ----- Global int silent Init(0); /* -s: suppress info messages? */ + #ifdef UNIX Global int m4pre Init(0); /* -m: use m4 preprocessor? [UNIX] */ ************** *** 39,40 Global int m4pre Init(0); /* -m: use m4 preprocessor? [UNIX] */ Global int uwarn Init(0); /* -u: warn about undefined ids? */ --- 40,42 ----- Global int m4pre Init(0); /* -m: use m4 preprocessor? [UNIX] */ + #endif Global int uwarn Init(0); /* -u: warn about undefined ids? */ *** old\lmem.c --- lmem.c ************** *** 21,22 #if AMIGA || ATARI_ST || HIGHC_386 || MACINTOSH || VMS /* nothing is needed */ --- 21,25 ----- #if AMIGA || ATARI_ST || HIGHC_386 || MACINTOSH || VMS + #ifdef __GNUC__ + #include + #else /* nothing is needed */ ************** *** 22,23 /* nothing is needed */ #endif /* AMIGA || ATARI_AT || HIGHC_386 ... */ --- 25,27 ----- /* nothing is needed */ + #endif #endif /* AMIGA || ATARI_AT || HIGHC_386 ... */ ************** *** 138,139 if (ipath == NULL) --- 142,145 ----- + #ifdef __GNU__ /* no really good reason for the code below */ + /* current working directory is searched first in any case */ if (ipath == NULL) ************** *** 184,185 */ --- 190,192 ----- */ + #endif /* __GNUC__ */ ************** *** 296,297 pptr = ipath; --- 303,308 ----- + #ifdef __GNUC__ + /* skip this search if IPATH is not defined */ + if (NULL != (pptr = ipath)) { + #else pptr = ipath; ************** *** 297,299 pptr = ipath; ! while (trypath(name, file)) { --- 308,310 ----- pptr = ipath; ! #endif /* __GNUC__ */ while (trypath(name, file)) { ************** *** 304,305 } } --- 315,317 ----- } + #ifdef __GNUC__ } ************** *** 305,306 } --- 317,320 ----- } + #endif /* __GNUC__ */ + } ************** *** 371,372 #if ATARI_ST || HIGHC_386 { --- 385,395 ----- #if ATARI_ST || HIGHC_386 + #ifdef __GNUC__ + struct stat statb; + char lclname[MaxFileName]; + if (access( makename(lclname,SourceDir,file,U1Suffix), 4 ) == 0 ) { + stat(lclname,&statb); + if (statb.st_mode & S_IFREG) + return 1; + } + #else { ************** *** 381,382 } #endif /* ATARI_ST || HIGHC_386 */ --- 404,406 ----- } + #endif #endif /* ATARI_ST || HIGHC_386 */ ************** *** 467,468 char c; --- 491,493 ----- char c; + char *pptrl; ************** *** 468,472 ! while (*pptr == ' ') ! pptr++; ! if (!*pptr) return 0; --- 493,517 ----- ! #ifndef ORIG ! /* Check if path separators already occur in 'name' - if yes ! abandon further search */ ! #if PORT ! Deliberate Syntax Error ! #endif /* PORT */ ! #if ATARI_ST ! pptrl = name; ! while (c = *pptrl++) { ! #ifdef __GNUC__ ! if ('\\' == c || '/' == c) ! #else /* __GNUC__ */ ! if ('\\' == c) ! #endif /* __GNUC__ */ ! return 0; ! } ! #endif /* ATARI_ST */ ! #endif /* ORIG */ ! ! pptrl = pptr; ! while (*pptrl == ' ') ! pptrl++; ! if (!*pptrl) return 0; ************** *** 473,475 do { ! c = (*file++ = *pptr++); } --- 518,520 ----- do { ! c = (*file++ = *pptrl++); } ************** *** 476,478 while (c != ' ' && c); ! pptr--; file--; --- 521,523 ----- while (c != ' ' && c); ! pptrl--; file--; ************** *** 478,479 file--; --- 523,525 ----- file--; + pptr = pptrl; ************** *** 502,504 ! #if ATARI_ST || MACINTOSH || MVS || VM || VMS /* nothing is needed */ --- 548,565 ----- ! #if ATARI_ST ! --file; ! #ifdef __GNUC__ ! if (('\\' != *file) && ('/' != *file)) { ! file++; ! *file = '\\'; ! } ! file++; ! #else /* __GNUC__ */ ! if ('\\' != *file++) { ! *file++ = '\\'; ! } ! #endif ! #endif /* ATARI_ST */ ! ! #if MACINTOSH || MVS || VM || VMS /* nothing is needed */ ************** *** 504,506 /* nothing is needed */ ! #endif /* ATARI_ST || MACINTOSH */ --- 565,567 ----- /* nothing is needed */ ! #endif /* MACINTOSH || MVS || VM || VMS */ *** old\makefile --- makefile ************** *** 0,0 --- 1,95 ----- + CC=gcc + CFLAGS=-O -fstrength-reduce -fcombine-regs -fomit-frame-pointer + LFLAGS=-x + + OBJS = err.o keyword.o lcode.o lglob.o link.o llex.o lmem.o lnklist.o \ + lsym.o opcode.o optab.o parse.o tcode.o tlex.o tmain.o \ + tmem.o toktab.o trans.o tree.o tsym.o tlocal.o util.o + + COBJS= ..\common\long.o ..\common\getopt.o + + LIBS=-liio + + PGM=icont.ttp + + all: $(PGM) + + $(PGM): $(OBJS) $(COBJS) + $(CC) $(CFLAGS) -o $(PGM) $(OBJS) $(COBJS) $(LIBS) $(LFLAGS) + toglclr $(PGM) # for TOS 1.4 + + clean: + $(RM) $(OBJS) + + ### + err.o : err.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h token.h tlex.h trans.h tree.h tproto.h + keyword.o : keyword.c ..\h\keyword.h tsym.h + lcode.o : lcode.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h globals.h sizes.h opcode.h \ + ..\h\opdefs.h link.h ..\h\rt.h ..\h\cpuconf.h ..\h\memsize.h \ + ..\h\keyword.h ..\h\version.h ..\h\header.h + lglob.o : lglob.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h link.h ..\h\rt.h \ + ..\h\cpuconf.h ..\h\memsize.h opcode.h ..\h\opdefs.h \ + ..\h\version.h + link.o : link.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h globals.h sizes.h link.h \ + ..\h\rt.h ..\h\cpuconf.h ..\h\memsize.h ..\h\paths.h \ + ..\h\header.h + llex.o : llex.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h link.h ..\h\rt.h \ + ..\h\cpuconf.h ..\h\memsize.h opcode.h ..\h\opdefs.h + lmem.o : lmem.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h globals.h sizes.h link.h \ + ..\h\rt.h ..\h\cpuconf.h ..\h\memsize.h + lnklist.o : lnklist.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h trans.h lfile.h + lsym.o : lsym.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h link.h ..\h\rt.h ..\h\cpuconf.h \ + ..\h\memsize.h general.h tproto.h globals.h sizes.h + opcode.o : opcode.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h link.h ..\h\rt.h \ + ..\h\cpuconf.h ..\h\memsize.h opcode.h ..\h\opdefs.h + optab.o : optab.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h tlex.h + parse.o : parse.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h tproto.h trans.h tsym.h tree.h ..\h\keyword.h + tcode.o : tcode.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h globals.h sizes.h trans.h \ + token.h tree.h tsym.h + tlex.o : tlex.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h trans.h token.h tlex.h \ + tree.h + tlocal.o : tlocal.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h + tmain.o : tmain.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h ..\h\paths.h globals.h \ + sizes.h + tmem.o : tmem.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h globals.h sizes.h trans.h \ + ..\h\memsize.h tsym.h tree.h + toktab.o : toktab.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h trans.h tlex.h token.h + trans.o : trans.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h ..\h\version.h globals.h \ + sizes.h trans.h tsym.h tree.h token.h + tree.o : tree.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h tree.h + tsym.o : tsym.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h globals.h sizes.h trans.h \ + token.h tsym.h lfile.h + util.o : util.c ..\h\config.h ..\h\define.h ..\h\proto.h \ + ..\common\cproto.h general.h tproto.h ..\h\cpuconf.h globals.h \ + sizes.h trans.h tree.h ..\h\fdefs.h + ### + ..\common\long.o : ..\common\long.c ..\h\config.h \ + ..\h\define.h ..\h\proto.h ..\common\cproto.h ..\h\cpuconf.h + pushd ..\common + make long.o + popd + ..\common\getopt.o : ..\common\getopt.c ..\h\config.h \ + ..\h\define.h ..\h\proto.h ..\common\cproto.h + pushd ..\common + make getopt.o + popd *** old\tlocal.c --- tlocal.c ************** *** 39,40 unsigned long _STACK = 10240; /* MNEED ALSO, PLEASE */ --- 39,43 ----- + #ifdef __GNUC__ + extern long _stksize = -1L; /* grab whole memory for translation */ + #else unsigned long _STACK = 10240; /* MNEED ALSO, PLEASE */ ************** *** 40,42 unsigned long _STACK = 10240; /* MNEED ALSO, PLEASE */ ! #endif /* ATARI_ST */ --- 43,45 ----- unsigned long _STACK = 10240; /* MNEED ALSO, PLEASE */ ! #endif #endif /* ATARI_ST */ *** old\tmain.c --- tmain.c ************** *** 9,10 /* --- 9,14 ----- + #if ATARI_ST + #else + #define EXECX /* define if calling iconx is supported */ + #endif /* ATARI_ST */ /* ************** *** 13,14 hidden novalue execute Params((char *ofile,char *efile,char * *args)); --- 17,19 ----- + #ifdef EXECX hidden novalue execute Params((char *ofile,char *efile,char * *args)); ************** *** 14,15 hidden novalue execute Params((char *ofile,char *efile,char * *args)); hidden novalue report Params((char *s)); --- 19,21 ----- hidden novalue execute Params((char *ofile,char *efile,char * *args)); + #endif hidden novalue report Params((char *s)); ************** *** 32,33 #if ATARI_ST char *patharg; --- 38,40 ----- #if ATARI_ST + #ifdef EXECX char *patharg; ************** *** 33,34 char *patharg; #endif /* ATARI_ST */ --- 40,42 ----- char *patharg; + #endif #endif /* ATARI_ST */ ************** *** 89,90 char **rfiles, **rptr; /* list of files to remove */ char *efile = NULL; /* stderr file */ --- 97,99 ----- char **rfiles, **rptr; /* list of files to remove */ + #ifdef EXECX char *efile = NULL; /* stderr file */ ************** *** 90,91 char *efile = NULL; /* stderr file */ char buf[MaxFileName]; /* file name construction buffer */ --- 99,101 ----- char *efile = NULL; /* stderr file */ + #endif char buf[MaxFileName]; /* file name construction buffer */ ************** *** 100,101 #endif /* MACINTOSH */ --- 110,115 ----- #endif /* MACINTOSH */ + #ifndef ORIG + char *targetdir; + char *cptr; + #endif /* ORIG */ ************** *** 109,110 break; case 'e': /* -e file: redirect stderr */ --- 123,125 ----- break; + #ifdef EXECX case 'e': /* -e file: redirect stderr */ ************** *** 112,113 break; case 'm': /* -m: preprocess using m4(1) [UNIX] */ --- 127,130 ----- break; + #endif + #if UNIX case 'm': /* -m: preprocess using m4(1) [UNIX] */ ************** *** 115,116 break; case 'o': /* -o file: name output file */ --- 132,134 ----- break; + #endif case 'o': /* -o file: name output file */ ************** *** 120,121 #if ATARI_ST case 'p': /* -p path: iconx path [ATARI] */ --- 138,140 ----- #if ATARI_ST + #ifdef EXECX case 'p': /* -p path: iconx path [ATARI] */ ************** *** 123,124 break; #endif /* ATARI_ST */ --- 142,144 ----- break; + #endif #endif /* ATARI_ST */ ************** *** 135,139 - - case 'L': /* -L: enable linker debugging */ - #ifdef DeBugLinker --- 155,156 ----- #ifdef DeBugLinker ************** *** 139,140 #ifdef DeBugLinker Dflag = 1; --- 156,158 ----- #ifdef DeBugLinker + case 'L': /* -L: enable linker debugging */ Dflag = 1; ************** *** 140,141 Dflag = 1; #endif /* DeBugLinker */ --- 158,160 ----- Dflag = 1; + break; #endif /* DeBugLinker */ ************** *** 142,145 - break; - case 'S': /* -Sxnnnn: set a size */ --- 161,162 ----- case 'S': /* -Sxnnnn: set a size */ ************** *** 147,149 break; ! default: case 'x': /* -x illegal until after file list */ --- 164,166 ----- break; ! #ifdef EXECX case 'x': /* -x illegal until after file list */ ************** *** 149,150 case 'x': /* -x illegal until after file list */ usage(); --- 166,169 ----- case 'x': /* -x illegal until after file list */ + #endif + default: usage(); ************** *** 152,153 /* --- 171,199 ----- + #ifndef ORIG + /* establish in which directory create intermediate files */ + if (nolink || (NULL == (targetdir = getenv("TEMP")))) { + targetdir = TargetDir; + } else { + strcpy(buf, targetdir); + #if PORT + Deliberate syntax error + #endif /* PORT */ + /* Append path separator */ + #if ATARI_ST + cptr = buf + strlen(buf) - 1; + #ifdef __GNUC__ + if ('\\' != *cptr && '/' != *cptr) + #else + if ('\\' != *cptr) + #endif + { + cptr += 1; + *cptr++ = '\\'; + *cptr = '\0'; + targetdir = salloc (buf); + } + #endif /* ATARI_ST */ + } + #endif /* ORIG */ + /* ************** *** 164,165 while (optind < argc) { if (strcmp(argv[optind],"-x") == 0) /* stop at -x */ --- 210,212 ----- while (optind < argc) { + #ifdef EXECX if (strcmp(argv[optind],"-x") == 0) /* stop at -x */ ************** *** 166,168 break; ! else if (strcmp(argv[optind],"-") == 0) { *tptr++ = "-"; /* "-" means standard input */ --- 213,217 ----- break; ! else ! #endif ! if (strcmp(argv[optind],"-") == 0) { *tptr++ = "-"; /* "-" means standard input */ ************** *** 168,169 *tptr++ = "-"; /* "-" means standard input */ *lptr++ = *rptr++ = "stdin.u1"; --- 217,219 ----- *tptr++ = "-"; /* "-" means standard input */ + #ifdef ORIG *lptr++ = *rptr++ = "stdin.u1"; ************** *** 170,171 *rptr++ = "stdin.u2"; } --- 220,228 ----- *rptr++ = "stdin.u2"; + #else + strcpy(buf, targetdir); + strcat(buf, "stdin.u1"); + *lptr++ = *rptr++ = salloc(buf); + buf[strlen(buf) - 1] = '2'; /* "...stdin.u2" */ + *rptr++ = salloc(buf); + #endif /* ORIG */ } ************** *** 176,177 *tptr++ = salloc(buf); /* translate the .icn file */ makename(buf,TargetDir,argv[optind],U1Suffix); --- 233,235 ----- *tptr++ = salloc(buf); /* translate the .icn file */ + #ifdef ORIG makename(buf,TargetDir,argv[optind],U1Suffix); ************** *** 179,180 makename(buf,TargetDir,argv[optind],U2Suffix); *rptr++ = salloc(buf); /* also remove .u2 */ --- 237,243 ----- makename(buf,TargetDir,argv[optind],U2Suffix); + #else + makename(buf,targetdir,argv[optind],U1Suffix); + *lptr++ = *rptr++ = salloc(buf); /* link & remove .u1 */ + makename(buf,targetdir,argv[optind],U2Suffix); + #endif /* ORIG */ *rptr++ = salloc(buf); /* also remove .u2 */ ************** *** 183,184 || smatch(fp->ext,USuffix)) { makename(buf,TargetDir,argv[optind],U1Suffix); --- 246,248 ----- || smatch(fp->ext,USuffix)) { + #ifdef ORIG makename(buf,TargetDir,argv[optind],U1Suffix); ************** *** 184,185 makename(buf,TargetDir,argv[optind],U1Suffix); *lptr++ = salloc(buf); --- 248,254 ----- makename(buf,TargetDir,argv[optind],U1Suffix); + #else + /* we do not want to change locations of files to link */ + makename(buf,SourceDir,argv[optind],U1Suffix); + #endif /* ORIG */ + *lptr++ = salloc(buf); ************** *** 211,212 report("Translating"); errors = trans(tfiles); --- 280,282 ----- report("Translating"); + #ifdef ORIG errors = trans(tfiles); ************** *** 212,213 errors = trans(tfiles); if (errors > 0) /* exit if errors seen */ --- 282,286 ----- errors = trans(tfiles); + #else + errors = trans(tfiles, rfiles); + #endif /* ORIG */ if (errors > 0) /* exit if errors seen */ ************** *** 275,276 if (optind < argc) { --- 348,350 ----- + #ifdef EXECX if (optind < argc) { ************** *** 280,281 } --- 354,356 ----- } + #endif ************** *** 284,285 /* --- 359,361 ----- + #ifdef EXECX /* ************** *** 443,444 } --- 519,521 ----- } + #endif /* EXECX */ ************** *** 524,525 { fprintf(stderr,"usage: %s %s file ... [-x args]\n", progname, Usage); --- 601,603 ----- { + #ifdef EXECX fprintf(stderr,"usage: %s %s file ... [-x args]\n", progname, Usage); ************** *** 525,526 fprintf(stderr,"usage: %s %s file ... [-x args]\n", progname, Usage); exit(ErrorExit); --- 603,615 ----- fprintf(stderr,"usage: %s %s file ... [-x args]\n", progname, Usage); + #else + #if ATARI_ST + #undef Usage + #ifdef DeBugLinker + #define Usage "[-cstuL] [-o ofile] [-Sxnnnn]" + #else /* DeBugLinker */ + #define Usage "[-cstu] [-o ofile] [-Sxnnnn]" + #endif /* DeBugLinker */ + #endif /* ATARI_ST */ + fprintf(stderr,"usage: %s %s file ... \n", progname, Usage); + #endif exit(ErrorExit); *** old\tproto.h --- tproto.h ************** *** 8,10 int blocate Params((char *s)); ! struct node *c_str_leaf Params((int type,struct node *loc_model,char *c)); novalue codegen Params((struct node *t)); --- 8,12 ----- int blocate Params((char *s)); ! struct node *c_str_leaf Params((int type, ! struct node *loc_model, ! char *c)); novalue codegen Params((struct node *t)); ************** *** 29,31 novalue gout Params((FILE *fd)); ! struct node *i_str_leaf Params((int type,struct node *loc_model,char *c,int d)); int ilink Params((char * *ifiles,char *outname)); --- 31,36 ----- novalue gout Params((FILE *fd)); ! struct node *i_str_leaf Params((int type, ! struct node *loc_model, ! char *c, ! int d)); int ilink Params((char * *ifiles,char *outname)); ************** *** 48,50 novalue putfield Params((char *fname,int rnum,int fnum)); ! struct gentry *putglobal Params((char *id,int flags,int nargs,int procid)); char *putid Params((int len)); --- 53,58 ----- novalue putfield Params((char *fname,int rnum,int fnum)); ! struct gentry *putglobal Params((char *id, ! int flags, ! int nargs, ! int procid)); char *putid Params((int len)); ************** *** 67,68 novalue tminit Params((noargs)); int trans Params((char * *ifiles)); --- 75,77 ----- novalue tminit Params((noargs)); + #ifdef ORIG int trans Params((char * *ifiles)); ************** *** 68,69 int trans Params((char * *ifiles)); struct node *tree1 Params((int type)); --- 77,81 ----- int trans Params((char * *ifiles)); + #else + int trans Params((char **ifiles, char **ufiles)); + #endif /* ORIG */ struct node *tree1 Params((int type)); ************** *** 70,75 struct node *tree2 Params((int type,struct node *loc_model)); ! struct node *tree3 Params((int type,struct node *loc_model,struct node *c)); ! struct node *tree4 Params((int type,struct node *loc_model,struct node *c,struct node *d)); ! struct node *tree5 Params((int type,struct node *loc_model,struct node *c,struct node *d, struct node *e)); ! struct node *tree6 Params((int type,struct node *loc_model,struct node *c, struct node *e, struct node *d, struct node *e, struct node *f)); novalue treeinit Params((noargs)); --- 82,101 ----- struct node *tree2 Params((int type,struct node *loc_model)); ! struct node *tree3 Params((int type, ! struct node *loc_model, ! struct node *c)); ! struct node *tree4 Params((int type, ! struct node *loc_model, ! struct node *c, ! struct node *d)); ! struct node *tree5 Params((int type, ! struct node *loc_model, ! struct node *c, ! struct node *d, ! struct node *e)); ! struct node *tree6 Params((int type, ! struct node *loc_model, ! struct node *c, ! struct node *d, ! struct node *e, ! struct node *f)); novalue treeinit Params((noargs)); *** old\trans.c --- trans.c ************** *** 18,19 hidden FILE *preprocess Params((char *filename)); --- 18,20 ----- + #if UNIX hidden FILE *preprocess Params((char *filename)); ************** *** 19,20 hidden FILE *preprocess Params((char *filename)); hidden novalue trans1 Params((char *filename)); --- 20,23 ----- hidden FILE *preprocess Params((char *filename)); + #endif + #ifdef ORIG hidden novalue trans1 Params((char *filename)); ************** *** 20,21 hidden novalue trans1 Params((char *filename)); --- 23,29 ----- hidden novalue trans1 Params((char *filename)); + #else + hidden novalue trans1 Params((char *filename, + char *u1name, + char *u2name)); + #endif /* ORIG */ ************** *** 33,34 /* --- 41,43 ----- + #ifdef ORIG /* ************** *** 38,39 char **ifiles; { --- 47,58 ----- char **ifiles; + #else + /* + * translate a number of files, returning an error count; + * ufiles is a list of names of intermediate files corresponding + * to source files on ifiles list + */ + int trans(ifiles, ufiles) + char **ifiles; + char **ufiles; + #endif /* ORIG */ { ************** *** 47,48 while (*ifiles) trans1(*ifiles++); /* translate each file in turn */ --- 66,68 ----- while (*ifiles) + #ifdef ORIG trans1(*ifiles++); /* translate each file in turn */ ************** *** 48,49 trans1(*ifiles++); /* translate each file in turn */ tmfree(); /* free memory used for translation */ --- 68,76 ----- trans1(*ifiles++); /* translate each file in turn */ + #else + { + char *u1name = *ufiles++; + trans1(*ifiles++, u1name, *ufiles++); + /* translate each file in turn */ + } + #endif /* ORIG */ tmfree(); /* free memory used for translation */ ************** *** 63,64 /* --- 90,92 ----- + #ifdef ORIG /* ************** *** 68,69 char *filename; { --- 96,106 ----- char *filename; + #else + /* + * translate one file creating intermediate code in u1name and u2name + */ + static novalue trans1(filename, u1name, u2name) + char *filename; + char *u1name; + char *u2name; + #endif /* ORIG */ { ************** *** 69,70 { char oname[MaxFileName]; /* buffer for constructing file names */ --- 106,108 ----- { + #ifdef ORIG char oname[MaxFileName]; /* buffer for constructing file names */ ************** *** 70,71 char oname[MaxFileName]; /* buffer for constructing file names */ --- 108,110 ----- char oname[MaxFileName]; /* buffer for constructing file names */ + #endif /* ORIG */ ************** *** 78,79 if (m4pre) --- 117,119 ----- + #if UNIX if (m4pre) ************** *** 80,82 srcfile = preprocess(filename); ! else if (strcmp(filename,"-") == 0) { srcfile = stdin; --- 120,124 ----- srcfile = preprocess(filename); ! else ! #endif ! if (strcmp(filename,"-") == 0) { srcfile = stdin; ************** *** 97,98 makename(oname, TargetDir, filename, U1Suffix); --- 139,141 ----- + #ifdef ORIG makename(oname, TargetDir, filename, U1Suffix); ************** *** 98,99 makename(oname, TargetDir, filename, U1Suffix); --- 141,143 ----- makename(oname, TargetDir, filename, U1Suffix); + #endif /* ORIG */ ************** *** 106,107 */ codefile = fopen(oname, WriteBinary); /* avoid line splits */ --- 150,152 ----- */ + #ifdef ORIG codefile = fopen(oname, WriteBinary); /* avoid line splits */ ************** *** 107,108 codefile = fopen(oname, WriteBinary); /* avoid line splits */ #else /* MVS || VM */ --- 152,156 ----- codefile = fopen(oname, WriteBinary); /* avoid line splits */ + #else + codefile = fopen(u1name, WriteBinary); /* avoid line splits */ + #endif /* ORIG */ #else /* MVS || VM */ ************** *** 108,109 #else /* MVS || VM */ codefile = fopen(oname, WriteText); --- 156,158 ----- #else /* MVS || VM */ + #ifdef ORIG codefile = fopen(oname, WriteText); ************** *** 109,110 codefile = fopen(oname, WriteText); #endif /* MVS || VM */ --- 158,162 ----- codefile = fopen(oname, WriteText); + #else + codefile = fopen(u1name, WriteText); + #endif /* ORIG */ #endif /* MVS || VM */ ************** *** 112,113 if (codefile == NULL) quitf("cannot create %s", oname); --- 164,168 ----- if (codefile == NULL) + #ifndef ORIG + quitf("cannot create %s", u1name); + #else quitf("cannot create %s", oname); ************** *** 115,116 makename(oname, TargetDir, filename, U2Suffix); --- 170,172 ----- makename(oname, TargetDir, filename, U2Suffix); + #endif /* ORIG */ ************** *** 117,118 #if MVS || VM globfile = fopen(oname, WriteBinary); --- 173,175 ----- #if MVS || VM + #ifdef ORIG globfile = fopen(oname, WriteBinary); ************** *** 118,119 globfile = fopen(oname, WriteBinary); #else /* MVS || VM */ --- 175,179 ----- globfile = fopen(oname, WriteBinary); + #else + globfile = fopen(u2name, WriteBinary); + #endif /* ORIG */ #else /* MVS || VM */ ************** *** 119,120 #else /* MVS || VM */ globfile = fopen(oname, WriteText); --- 179,181 ----- #else /* MVS || VM */ + #ifdef ORIG globfile = fopen(oname, WriteText); ************** *** 120,121 globfile = fopen(oname, WriteText); #endif /* MVS || VM */ --- 181,185 ----- globfile = fopen(oname, WriteText); + #else + globfile = fopen(u2name, WriteText); + #endif /* ORIG */ #endif /* MVS || VM */ ************** *** 123,124 if (globfile == NULL) quitf("cannot create %s", oname); --- 187,189 ----- if (globfile == NULL) + #ifdef ORIG quitf("cannot create %s", oname); ************** *** 124,125 quitf("cannot create %s", oname); writecheck(fprintf(globfile,"version\t%s\n",UVersion)); --- 189,193 ----- quitf("cannot create %s", oname); + #else + quitf("cannot create %s", u2name); + #endif /* ORIG */ writecheck(fprintf(globfile,"version\t%s\n",UVersion)); ************** *** 161,162 /* --- 229,231 ----- + #if UNIX /* ************** *** 186 } --- 255,256 ----- } + #endif /* UNIX */ *** old\util.c --- util.c ************** *** 264,266 #define MinSize(x,y,z) ! #include "sizes.h" \* initialize from "sizes.h" data *\ #undef Size --- 264,266 ----- #define MinSize(x,y,z) ! #include "sizes.h" /* initialize from "sizes.h" data */ #undef Size