home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / c / cpp.lha / cpp.diffs < prev    next >
Text File  |  1991-08-05  |  24KB  |  773 lines

  1. Only in cpp.2: CHANGES
  2. diff -c cpp.1/Makefile cpp.2/Makefile
  3. *** cpp.1/Makefile      Mon Apr 15 22:32:33 1991
  4. --- cpp.2/Makefile      Sun Jul  7 05:59:43 1991
  5. ***************
  6. *** 18,25 ****
  7.   #CPPFLAGS =
  8.   #SRCS = cpp1.c cpp2.c cpp3.c cpp4.c cpp5.c cpp6.c
  9.  
  10.   CC = cc
  11. - CFLAGS = -O
  12.   CPPFLAGS = -DCOOL
  13.  
  14.   .SUFFIXES: .c .o
  15. --- 18,29 ----
  16.   #CPPFLAGS =
  17.   #SRCS = cpp1.c cpp2.c cpp3.c cpp4.c cpp5.c cpp6.c
  18.  
  19. + # Uncomment for Interactive Unix on PCs.
  20. + # MACHINE = -O -DM_INTERACTIVE
  21. + # LDFLAGS = -linet
  22. + CFLAGS = -O $(MACHINE)
  23. + # CFLAGS = -g $(MACHINE)
  24.   CC = cc
  25.   CPPFLAGS = -DCOOL
  26.  
  27.   .SUFFIXES: .c .o
  28. ***************
  29. *** 36,42 ****
  30.   #
  31.  
  32.   cpp: $(OBJS)
  33. !       $(CC) -o cpp $(OBJS)
  34.  
  35.   #
  36.   # ** Remove unneeded files
  37. --- 40,46 ----
  38.   #
  39.  
  40.   cpp: $(OBJS)
  41. !       $(CC) -o cpp $(OBJS) $(LDFLAGS)
  42.  
  43.   #
  44.   # ** Remove unneeded files
  45. ***************
  46. *** 43,49 ****
  47.   #
  48.  
  49.   clean:
  50. !       rm *.o cpp
  51.  
  52.   #
  53.   # ** Test cpp by preprocessing itself, compiling the result,
  54. --- 47,53 ----
  55.   #
  56.  
  57.   clean:
  58. !       rm -f *.o cpp
  59.  
  60.   #
  61.   # ** Test cpp by preprocessing itself, compiling the result,
  62. Only in cpp.2: Makeit.mk
  63. diff -c cpp.1/cpp.h cpp.2/cpp.h
  64. *** cpp.1/cpp.h Mon Apr 15 22:13:28 1991
  65. --- cpp.2/cpp.h Sun Jul  7 05:40:25 1991
  66. ***************
  67. *** 17,23 ****
  68.    * In general, definitions in this file should not be changed.
  69.    *
  70.    * Change History:
  71. !  * 19-Jan-90  DKM   Added support for MVS and EBCDIC character set
  72.    */
  73.  
  74.   #include "cppdef.h"
  75. --- 17,24 ----
  76.    * In general, definitions in this file should not be changed.
  77.    *
  78.    * Change History:
  79. !  * 19-Jan-90  DKM     Added support for MVS and EBCDIC character set
  80. !  * 25-Jun-91  GPD     Added support for Pyramid.
  81.    */
  82.  
  83.   #include "cppdef.h"
  84. ***************
  85. *** 267,272 ****
  86. --- 268,274 ----
  87.  
  88.   extern int    line;                   /* Current line number          */
  89.   extern int    wrongline;              /* Force #line to cc pass 1     */
  90. + extern int    wrongfile;              /* Force #line to cc pass 1     */
  91.   extern char   type[];                 /* Character classifier         */
  92.   extern char   *tokenbuf;              /* Current input token          */
  93.   extern int    tokenbsize;             /* Current size allocated in tokenbuf
  94. ***************
  95. *** 284,293 ****
  96. --- 286,297 ----
  97.   extern int    cflag;                  /* -C option (keep comments)    */
  98.   extern int    eflag;                  /* -E option (ignore errors)    */
  99.   extern int    nflag;                  /* -N option (no pre-defines)   */
  100. + extern int    yflag;                  /* -Y option (alt stdincl)      */
  101.   extern int    rec_recover;            /* unwind recursive macros      */
  102.   extern char   *preset[];              /* Standard predefined symbols  */
  103.   extern char   *magic[];               /* Magic predefined symbols     */
  104.   extern FILEINFO       *infile;                /* Current input file           */
  105. + extern char   *altincl;               /* Alternate std include dir    */
  106.   extern char   work[NWORK + 1];        /* #define scratch              */
  107.   extern char   *workp;                 /* Free space in work           */
  108.   extern int    debug;                  /* Debug level                  */
  109. ***************
  110. *** 300,305 ****
  111. --- 304,313 ----
  112.   extern char   *savestring();          /* Stuff string in malloc mem.  */
  113.   extern char   *strcpy();
  114.   extern char   *strcat();
  115. + #if pyr
  116. + #define strchr index
  117. + #define strrchr rindex
  118. + #endif
  119.   extern char   *strrchr();
  120.   extern char   *strchr();
  121.  
  122. ***************
  123. *** 308,314 ****
  124. --- 316,324 ----
  125.   #endif
  126.  
  127.   #if (HOST != SYS_OS2 && HOST != SYS_XENIX && HOST != SYS_MVS && HOST != SYS_AIX)
  128. + #if defined(sun) || (!defined(i386) && !defined(unix))
  129.   extern char   *sprintf();             /* Lint needs this              */
  130. + #endif
  131.   #endif
  132.  
  133.   typedef int (*internal_expander) ();
  134. Only in cpp.1: cpp.lzh
  135. diff -c cpp.1/cpp1.c cpp.2/cpp1.c
  136. *** cpp.1/cpp1.c        Mon Apr 15 22:13:20 1991
  137. --- cpp.2/cpp1.c        Sun Jul  7 06:28:37 1991
  138. ***************
  139. *** 97,102 ****
  140. --- 97,107 ----
  141.    * 18-May-90    MBN     Conditional compilation on COOL to get "clean" cpp
  142.    * 21-May-90    MJF     Added DECLARE_ONCE for CCC -X
  143.    * 20-Aug-90    MJF     Added typecase external function reference
  144. +  * 16-Jun-91    GPD     Added support for Sun -Y option
  145. +  *                    Fix -N by putting initdefines() after dooptions()
  146. +  *                    Added throw macro support to jump table
  147. +  * 25-Jun-91  GPD     Fixes to make ## operator expansion ANSI conformant.
  148. +  * 07-Jul-91  GPD     Fix #line nesting. Added wrongfile.
  149.    */
  150.  
  151.   /*)BUILD
  152. ***************
  153. *** 394,399 ****
  154. --- 399,405 ----
  155.   extern int generate();                    /* macro looping mechanism */
  156.   extern int compress();                    /* compress out white space */
  157.   extern int typecase();                    /* typecase macro */
  158. + extern int throw();               /* throw macro */
  159.  
  160.   struct expander_pair internal_macros[] = {
  161.     {"parmtype", parmtype},
  162. ***************
  163. *** 411,416 ****
  164. --- 417,423 ----
  165.     {"generate", generate},
  166.     {"compress", compress},
  167.     {"typecase", typecase},
  168. +   {"throw", throw},
  169.     {NULL, NULL}};
  170.  
  171.   #endif
  172. ***************
  173. *** 421,426 ****
  174. --- 428,436 ----
  175.    * wrongline  is set in many places when the actual output
  176.    *            line is out of sync with the numbering, e.g,
  177.    *            when expanding a macro with an embedded newline.
  178. +  * wrongfile  is set when the reason for the output line being
  179. +  *            out of sync is because we have just left a nested
  180. +  *            include file.
  181.    *
  182.    * tokenbuf   holds the last identifier scanned (which might
  183.    *            be a candidate for macro expansion).
  184. ***************
  185. *** 432,437 ****
  186. --- 442,448 ----
  187.    */
  188.   int           line;                   /* Current line number          */
  189.   int           wrongline;              /* Force #line to compiler      */
  190. + int           wrongfile = FALSE;      /* Force #line to compiler      */
  191.   char          *tokenbuf;              /* Buffer for current input token */
  192.   int           tokenbsize;             /* Allocated size of tokenbuf, */
  193.                                         /* not counting zero at end.  */
  194. ***************
  195. *** 438,443 ****
  196. --- 449,456 ----
  197.   int           errors;                 /* cpp error counter            */
  198.   FILEINFO      *infile = NULL;         /* Current input file           */
  199.   int           debug;                  /* TRUE if debugging now        */
  200. + char          *altincl = NULL;        /* Alternate std include dir    */
  201. +                                       /* Set using -Y option          */
  202.   /*
  203.    * This counter is incremented when a macro expansion is initiated.
  204.    * If it exceeds a built-in value, the expansion stops -- this tests
  205. ***************
  206. *** 502,507 ****
  207. --- 515,521 ----
  208.   int           cflag = FALSE;          /* -C option (keep comments)    */
  209.   int           eflag = FALSE;          /* -E option (never fail)       */
  210.   int           nflag = 0;              /* -N option (no predefines)    */
  211. + int           yflag = FALSE;          /* -Y option (replace std incl) */
  212.  
  213.   /*
  214.    * ifstack[] holds information about nested #if's.  It is always
  215. ***************
  216. *** 560,567 ****
  217.   #if HOST == SYS_VMS
  218.         argc = getredirection(argc, argv);      /* vms >file and <file  */
  219.   #endif
  220. -       initdefines();                          /* O.S. specific def's  */
  221.         i = dooptions(argc, argv);              /* Command line -flags  */
  222.         switch (i) {
  223.         case 3:
  224.             /*
  225. --- 574,581 ----
  226.   #if HOST == SYS_VMS
  227.         argc = getredirection(argc, argv);      /* vms >file and <file  */
  228.   #endif
  229.         i = dooptions(argc, argv);              /* Command line -flags  */
  230. +       initdefines();                          /* O.S. specific def's  */
  231.         switch (i) {
  232.         case 3:
  233.             /*
  234. ***************
  235. *** 674,680 ****
  236.                 if (keepcomments)               /* in this line.        */
  237.                   putchar(c);
  238.               if (c == '\n')                    /* If line's all blank, */
  239. !               if(keepcomments)
  240.                   putchar('\n');
  241.                 else
  242.                   ++counter;                    /* Do nothing now       */
  243. --- 688,696 ----
  244.                 if (keepcomments)               /* in this line.        */
  245.                   putchar(c);
  246.               if (c == '\n')                    /* If line's all blank, */
  247. !               if (wrongfile)
  248. !                 counter = 0;
  249. !               else if (keepcomments)
  250.                   putchar('\n');
  251.                 else
  252.                   ++counter;                    /* Do nothing now       */
  253. ***************
  254. *** 739,747 ****
  255.                 break;
  256.  
  257.  
  258. -             case DIG:                   /* Output a number    */
  259.               case DOT:                   /* Dot may begin floats       */
  260.                 scannumber(c, output);
  261.                 break;
  262.  
  263.               case QUO:                   /* char or string const       */
  264. --- 755,780 ----
  265.                 break;
  266.  
  267.  
  268.               case DOT:                   /* Dot may begin floats       */
  269. +               if (type[get()] != DIG)
  270. +               {
  271. +                   unget();
  272. +                   output('.');
  273. +                   break;                /* Not a float after all      */
  274. +               }
  275. +               else
  276. +                   unget();              /* Fall through       */
  277. +
  278. +             case DIG:                   /* Output a number    */
  279.                 scannumber(c, output);
  280. +               c = get();
  281. +               if (type[c] == LET || c == '.')
  282. +               {
  283. +                   scanid(c);          /* Don't expand id after num    */
  284. +                   fputs(tokenbuf, stdout);
  285. +               }
  286. +               else
  287. +                   unget();
  288.                 break;
  289.  
  290.               case QUO:                   /* char or string const       */
  291. diff -c cpp.1/cpp2.c cpp.2/cpp2.c
  292. *** cpp.1/cpp2.c        Mon Apr 15 22:13:21 1991
  293. --- cpp.2/cpp2.c        Sun Jul  7 06:33:22 1991
  294. ***************
  295. *** 30,35 ****
  296. --- 30,38 ----
  297.    * 23-Apr-90    MJF     Include file parsing ignore // or /* as comment
  298.    * 01-May-90    MJF     unrecognized #pragma needs to output newline
  299.    * 18-May-90    MBN     Conditional compilation for COOL to get "clean" cpp
  300. +  * 25-Jun-91  GPD     Remove #elif to make more portable.
  301. +  *                    Added support for Interactive Unix.
  302. +  * 01-Jul-91  GPD     Fix search for include in local directory first.
  303.    */
  304.  
  305.   #include      <stdio.h>
  306. ***************
  307. *** 39,55 ****
  308.  
  309.   #if defined(vms)
  310.   #include        <types.h>
  311. ! #elif !defined(SYS_OSVS)
  312.   #include        <sys/types.h>
  313.   #endif
  314.  
  315.   #if defined(vms)
  316.   #include        <file.h>
  317. ! #elif defined(SYS_OSVS)
  318.   #include        <fcntl.h>
  319. ! #elif !defined(DOS) && !defined(MSDOS)
  320.   #include        <sys/file.h>
  321.   #endif
  322.  
  323.   #if defined(vms)
  324.   /*
  325. --- 42,67 ----
  326.  
  327.   #if defined(vms)
  328.   #include        <types.h>
  329. ! #else
  330. ! #if !defined(SYS_OSVS)
  331.   #include        <sys/types.h>
  332.   #endif
  333. + #endif
  334.  
  335.   #if defined(vms)
  336.   #include        <file.h>
  337. ! #else
  338. ! #if defined(SYS_OSVS)
  339.   #include        <fcntl.h>
  340. ! #else
  341. ! #if !defined(DOS) && !defined(MSDOS)
  342. ! #if defined(M_INTERACTIVE)
  343. ! #include      <unistd.h>
  344. ! #endif
  345.   #include        <sys/file.h>
  346.   #endif
  347. + #endif
  348. + #endif
  349.  
  350.   #if defined(vms)
  351.   /*
  352. ***************
  353. *** 626,632 ****
  354.              * Look in local directory first
  355.              */
  356.             if (!hasdirectory(filename, tmpname, TRUE)
  357. !            && hasdirectory(infile->filename, tmpname, TRUE))
  358.                 strcat(tmpname, filename);
  359.             else {
  360.                 strcpy(tmpname, filename);
  361. --- 638,644 ----
  362.              * Look in local directory first
  363.              */
  364.             if (!hasdirectory(filename, tmpname, TRUE)
  365. !            && hasdirectory(infile->filename, tmpname, FALSE))
  366.                 strcat(tmpname, filename);
  367.             else {
  368.                 strcpy(tmpname, filename);
  369. diff -c cpp.1/cpp3.c cpp.2/cpp3.c
  370. *** cpp.1/cpp3.c        Mon Apr 15 22:13:21 1991
  371. --- cpp.2/cpp3.c        Sun Jul  7 05:57:26 1991
  372. ***************
  373. *** 22,27 ****
  374. --- 22,32 ----
  375.    * 24-Sep-89    AFM     OS2, XENIX and AIX support.
  376.    * 19-Jan-90    DKM     MVS support.
  377.    * 18-May-90    MBN     Conditional compilation for COOL to get "clean" cpp
  378. +  * 16-Jun-91    GPD     Added support for Sun -Y option
  379. +  *                    Added support for Sun -undef option
  380. +  * 01-Jul-91  GPD     Add __COOL__ as a predefined symbol.
  381. +  * 07-Jul-91  GPD     Fix #line nesting. Force sharp() before processing
  382. +  *                    new file if wrongline.
  383.    */
  384.  
  385.  
  386. ***************
  387. *** 72,77 ****
  388. --- 77,84 ----
  389.         if (debug)
  390.             fprintf(stderr, "Reading from \"%s\"\n", filename);
  391.   #endif
  392. +       if (wrongline)
  393. +         sharp();
  394.         addfile(fp, filename);
  395.         return (TRUE);
  396.   }
  397. ***************
  398. *** 112,118 ****
  399.   #endif
  400.  
  401.   #if (HOST == SYS_UNIX || HOST == SYS_XENIX || HOST == SYS_AIX)
  402. !       *incend++ = "/usr/include";
  403.   #define       MAXINCLUDE      (NINCLUDE - 1 - IS_INCLUDE)
  404.   #endif
  405.  
  406. --- 119,128 ----
  407.   #endif
  408.  
  409.   #if (HOST == SYS_UNIX || HOST == SYS_XENIX || HOST == SYS_AIX)
  410. !       if (yflag && altincl)
  411. !           *incend++ = altincl;
  412. !       else
  413. !           *incend++ = "/usr/include";
  414.   #define       MAXINCLUDE      (NINCLUDE - 1 - IS_INCLUDE)
  415.   #endif
  416.  
  417. ***************
  418. *** 276,289 ****
  419.                         cwarn("-S, too many values, \"%s\" unused", ap);
  420.                     break;
  421.  
  422. -               case 'U':                       /* Undefine symbol      */
  423. - #if (HOST != SYS_UNIX && HOST != SYS_XENIX && HOST != SYS_OS2 && HOST != SYS_MVS && HOST != SYS_AIX)
  424. -                   zap_uc(ap);
  425. - #endif
  426. -                   if (defendel(ap, TRUE) == NULL)
  427. -                       cwarn("\"%s\" wasn't defined", ap);
  428. -                   break;
  429. -
  430.                 case 'X':                       /* Debug                */
  431.                     debug = (isdigit(*ap)) ? atoi(ap) : 1;
  432.   #if DEBUG
  433. --- 286,291 ----
  434. ***************
  435. *** 294,299 ****
  436. --- 296,320 ----
  437.                     fprintf(stderr, "Debug set to %d\n", debug);
  438.                     break;
  439.  
  440. +               case 'Y':
  441. +                   altincl = ap;
  442. +                   yflag = TRUE;
  443. +                   break;
  444. +
  445. +               case 'U':                       /* Undefine symbol      */
  446. + #if (HOST != SYS_UNIX && HOST != SYS_XENIX && HOST != SYS_OS2 && HOST != SYS_MVS && HOST != SYS_AIX)
  447. +                   zap_uc(ap);
  448. + #endif
  449. +                   if (strcmp(ap-1,"undef") == 0)
  450. +                   {
  451. +                       if (nflag == 0)
  452. +                           nflag = 1;
  453. +                       break;
  454. +                   }
  455. +                   if (defendel(ap, TRUE) == NULL)
  456. +                       cwarn("\"%s\" wasn't defined", ap);
  457. +                   break;
  458. +
  459.                 default:                        /* What is this one?    */
  460.                     cwarn("Unknown option \"%s\"", arg);
  461.                     fprintf(stderr, "The following options are valid:\n\
  462. ***************
  463. *** 387,392 ****
  464. --- 408,416 ----
  465.           define_builtin("__LINE__", expand_line, "");
  466.           define_builtin("__FILE__", expand_file, "");
  467.           define_builtin("__STDC__", NULL, "1");
  468. + #ifdef COOL
  469. +         define_builtin("__COOL__", NULL, "1");
  470. + #endif
  471.   #if OK_DATE
  472.           /*
  473.            * Define __DATE__ as today's date.
  474. diff -c cpp.1/cpp4.c cpp.2/cpp4.c
  475. *** cpp.1/cpp4.c        Mon Apr 15 22:13:21 1991
  476. --- cpp.2/cpp4.c        Sun Jul  7 06:29:16 1991
  477. ***************
  478. *** 30,35 ****
  479. --- 30,36 ----
  480.    *                    In doundef, don't complain if arg already not defined.
  481.    * 20-Apr-90    MJF     Changed redefining of defined variable to a warning
  482.    * 18-May-90    MBN     Conditional compilation for COOL to get "clean" cpp
  483. +  * 25-Jun-91  GPD     Fixes to make ## operator expansion ANSI conformant.
  484.    */
  485.  
  486.   #include      <stdio.h>
  487. ***************
  488. *** 141,147 ****
  489.                 continue;}
  490.               while (workp > work && type[(unsigned char)workp[-1]] == SPA)
  491.                 --workp;                        /* Erase leading spaces */
  492. !             save(TOK_SEP);                    /* Stuff a delimiter    */
  493.               c = skipws();                     /* Eat whitespace       */
  494.               continue;
  495.             }
  496. --- 142,148 ----
  497.                 continue;}
  498.               while (workp > work && type[(unsigned char)workp[-1]] == SPA)
  499.                 --workp;                        /* Erase leading spaces */
  500. !             /* save(TOK_SEP); */              /* Stuff a delimiter    */
  501.               c = skipws();                     /* Eat whitespace       */
  502.               continue;
  503.             }
  504. ***************
  505. *** 596,602 ****
  506.                   } /* if string_magic */
  507.                 } /* if valid parm */
  508.               } /* if parm */
  509. !             else
  510.                 *defp++ = c;
  511.             }
  512.           }
  513. --- 597,603 ----
  514.                   } /* if string_magic */
  515.                 } /* if valid parm */
  516.               } /* if parm */
  517. !             else if (c != DEF_MAGIC)
  518.                 *defp++ = c;
  519.             }
  520.           }
  521. diff -c cpp.1/cpp6.c cpp.2/cpp6.c
  522. *** cpp.1/cpp6.c        Mon Apr 15 22:13:21 1991
  523. --- cpp.2/cpp6.c        Sun Jul  7 05:58:34 1991
  524. ***************
  525. *** 37,42 ****
  526. --- 37,43 ----
  527.    * 19-Jan-90 DKM        Support for MVS and EBCDIC character set
  528.    * 02-May-90 MJF        Backslash<newline> not expanded in scanstring()
  529.    * 02-May-90 MJF        Added macro recursion fixes by Aditya in macroid()
  530. +  * 07-Jul-91 GPD      Fix #line nesting. Added wrongfile.
  531.    */
  532.  
  533.   #include      <stdio.h>
  534. ***************
  535. *** 820,825 ****
  536. --- 821,831 ----
  537.             else {                        /* Else get from a file       */
  538.               if ((file->bptr = fgets(file->buffer, NBUFF, file->fp))
  539.                   != NULL) {
  540. +           if (wrongfile == TRUE)
  541. +           {
  542. +             wrongfile = FALSE;
  543. +             sharp();
  544. +           }
  545.   #if DEBUG
  546.                 if (debug > 1) {          /* Dump it to stdout  */
  547.                   printf("\n#line %d (%s), %s",
  548. ***************
  549. *** 838,844 ****
  550.                    * is skipping over blank lines and will do a
  551.                    * #line at its convenience.
  552.                    */
  553. !                 wrongline = TRUE;       /* Need a #line now   */
  554.                 }
  555.               }
  556.             }
  557. --- 844,851 ----
  558.                    * is skipping over blank lines and will do a
  559.                    * #line at its convenience.
  560.                    */
  561. !                 /* wrongline = TRUE; */  /* Need a #line now  */
  562. !                 wrongfile = TRUE;
  563.                 }
  564.               }
  565.             }
  566. diff -c cpp.1/cpp7.c cpp.2/cpp7.c
  567. *** cpp.1/cpp7.c        Mon Apr 15 22:13:21 1991
  568. --- cpp.2/cpp7.c        Sun Jul  7 04:47:34 1991
  569. ***************
  570. *** 22,27 ****
  571. --- 22,29 ----
  572.    * 20-Oct-89    AFM     OS2, XENIX and AIX port.
  573.    * 19-Jan-90    DKM     MVS support
  574.    * 01-Sep-90    MJF     External macros support for OS/2 by using temp file
  575. +  * 25-Jun-91  GPD     Remove #elif to make more portable.
  576. +  *                    Added support for Interactive Unix.
  577.    */
  578.  
  579.   #include      <stdio.h>
  580. ***************
  581. *** 30,38 ****
  582.  
  583.   #if defined(vms)
  584.   #include        <types.h>
  585. ! #elif !defined(SYS_OSVS)
  586.   #include        <sys/types.h>
  587.   #endif
  588.  
  589.   #if defined(_AIX)
  590.   #include        <sys/select.h>
  591. --- 32,42 ----
  592.  
  593.   #if defined(vms)
  594.   #include        <types.h>
  595. ! #else
  596. ! #if !defined(SYS_OSVS)
  597.   #include        <sys/types.h>
  598.   #endif
  599. + #endif
  600.  
  601.   #if defined(_AIX)
  602.   #include        <sys/select.h>
  603. ***************
  604. *** 44,59 ****
  605.   #include        <string.h>
  606.   #include        <sys/fcntl.h>
  607.   #include        <sys/file.h>
  608. ! #elif defined(DOS) || defined(MSDOS)
  609.   #include        <string.h>
  610.   #include        <fcntl.h>
  611. ! #elif defined(SYS_OSVS)
  612.   #include        <string.h>
  613.   #include        <fcntl.h>
  614. ! #elif defined(vms)
  615.   #include        <file.h>
  616.   #else
  617.   #include        <sys/file.h>
  618.   #endif
  619.  
  620.   #if HOST == SYS_VMS
  621. --- 48,74 ----
  622.   #include        <string.h>
  623.   #include        <sys/fcntl.h>
  624.   #include        <sys/file.h>
  625. ! #else
  626. ! #if defined(DOS) || defined(MSDOS)
  627.   #include        <string.h>
  628.   #include        <fcntl.h>
  629. ! #else
  630. ! #if defined(SYS_OSVS)
  631.   #include        <string.h>
  632.   #include        <fcntl.h>
  633. ! #else
  634. ! #if defined(vms)
  635.   #include        <file.h>
  636.   #else
  637. + #if defined(M_INTERACTIVE)
  638. + #include      <unistd.h>
  639. + #include      <sys/bsdtypes.h>
  640. + #include      <sys/fcntl.h>
  641. + #endif
  642.   #include        <sys/file.h>
  643. + #endif
  644. + #endif
  645. + #endif
  646.   #endif
  647.  
  648.   #if HOST == SYS_VMS
  649. diff -c cpp.1/cppdef.h cpp.2/cppdef.h
  650. *** cpp.1/cppdef.h      Mon Apr 15 22:13:29 1991
  651. --- cpp.2/cppdef.h      Tue Jun 25 04:55:02 1991
  652. ***************
  653. *** 26,33 ****
  654.    * If this is not the case, you will have to do some editing here and there.
  655.    *
  656.    *  Change History
  657. !  *  19-Jan-90  DKM  Support for MVS and EBCDIC character set
  658. !  *  04-May-90  MJF  Added predefined constant "sun"
  659.    */
  660.  
  661.   #ifndef CPPDEFH
  662. --- 26,34 ----
  663.    * If this is not the case, you will have to do some editing here and there.
  664.    *
  665.    *  Change History
  666. !  *  19-Jan-90 DKM     Support for MVS and EBCDIC character set
  667. !  *  04-May-90 MJF     Added predefined constant "sun"
  668. !  *  16-Jun-91 GPD     Fixed predefines for sun, pyr and i386 architectures
  669.    */
  670.  
  671.   #ifndef CPPDEFH
  672. ***************
  673. *** 264,273 ****
  674. --- 265,283 ----
  675.   #ifdef  sparc
  676.   #define MACHINE                 "sparc"
  677.   #endif
  678. + #ifdef  mc68020
  679. + #define MACHINE                 "mc68020", "mc68000"
  680. + #endif
  681.   #ifdef  sun
  682.   #define TARGET_ARCH             "sun"
  683.   #endif
  684. + #ifdef  pyr
  685. + #define MACHINE                 "pyr"
  686.   #endif
  687. + #ifdef  i386
  688. + #define MACHINE                 "i386"
  689. + #endif
  690. + #endif
  691.  
  692.   /*
  693.    * defaults
  694. ***************
  695. *** 335,341 ****
  696.    * (Or is it the other way around?) -- Warning: BIG_ENDIAN code is untested.
  697.    */
  698.   #ifndef       BIG_ENDIAN
  699. ! #if HOST == SYS_MVS
  700.   #define BIG_ENDIAN              TRUE      /* Is this right??? */
  701.   #else
  702.   #define       BIG_ENDIAN              FALSE
  703. --- 345,351 ----
  704.    * (Or is it the other way around?) -- Warning: BIG_ENDIAN code is untested.
  705.    */
  706.   #ifndef       BIG_ENDIAN
  707. ! #if (HOST == SYS_MVS) || defined(i386)
  708.   #define BIG_ENDIAN              TRUE      /* Is this right??? */
  709.   #else
  710.   #define       BIG_ENDIAN              FALSE
  711. diff -c cpp.1/template.c cpp.2/template.c
  712. *** cpp.1/template.c    Mon Apr 15 23:03:36 1991
  713. --- cpp.2/template.c    Sun Jul  7 06:30:04 1991
  714. ***************
  715. *** 18,23 ****
  716. --- 18,24 ----
  717.    * Updated: MJF 21-May-90 -- Added DECLARE_ONCE for CCC -X.
  718.    * Updated: MJF 01-Mar-91 -- Added fix when expanding member functions
  719.    *                           which return a template class
  720. +  * Updated: GPD       25-Jun-91 -- Fix #line nesting. When template expansions done.
  721.    *
  722.    * Template, DECLARE and IMPLEMENT defmacro
  723.    *
  724. ***************
  725. *** 115,120 ****
  726. --- 116,122 ----
  727.   */
  728.  
  729.   #include "defmacio.h"
  730. + #include "cppdef.h"
  731.  
  732.   /* maximum number of template parameters */
  733.   #define max_parms 32
  734. ***************
  735. *** 308,313 ****
  736. --- 310,317 ----
  737.         return 1;
  738.       }
  739.       for(templ = th->head; templ != NULL; templ = templ->next) {
  740. +       char lbuff[256];
  741. +       FILEINFO* finfo = MacOutFile;
  742.         switch (do_what) {
  743.         case do_declare:   if(templ->type == implement_template) continue; break;
  744.         case do_implement: if(templ->type != implement_template) continue; break;
  745. ***************
  746. *** 317,322 ****
  747. --- 321,333 ----
  748.         if (n-- > 0) continue;
  749.         /* else fall through to implement template n */
  750.         }
  751. +       while (finfo && !finfo->fp)
  752. +       finfo = finfo->parent;
  753. +       if (finfo)
  754. +       {
  755. +       sprintf(lbuff,"\n#line %d \"%s\"\n", finfo->line, finfo->filename);
  756. +       puts(lbuff);
  757. +       }
  758.         if (do_line) {
  759.         char* bodyp = templ->body;
  760.         int newline = 0;
  761. ***************
  762. *** 331,336 ****
  763. --- 342,349 ----
  764.         if(!newline) putchar('\n');
  765.         }
  766.         macro_substitute(templ->body, nparms, templ->args, parms);
  767. +       if (finfo)
  768. +       puts(lbuff);
  769.       }
  770.     }
  771.     if (do_what == do_implement_n && n >= 0) {
  772.  
  773.