home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnudc.zip / patches.os2 < prev    next >
Text File  |  1993-05-22  |  2KB  |  113 lines

  1. Only in new: Makefile
  2. Only in new: patches.os2
  3. diff -cb orig/dc.c new/dc.c
  4. *** orig/dc.c    Wed May 19 16:30:20 1993
  5. --- new/dc.c    Sat May 22 14:25:42 1993
  6. ***************
  7. *** 20,25 ****
  8. --- 20,28 ----
  9.    */
  10.   
  11.   #include <stdio.h>
  12. + #ifdef __EMX__
  13. + #include <stdlib.h>
  14. + #endif
  15.   #include "decimal.h"  /* definitions for our decimal arithmetic package */
  16.   
  17.   FILE *open_file;    /* input file now open */
  18. ***************
  19. *** 90,100 ****
  20. --- 93,107 ----
  21.   void free_regstack ();
  22.   void pushreg ();
  23.   void execute ();
  24. + #ifndef __EMX__
  25.   void fputchar ();
  26. + #endif
  27.   void push ();
  28.   void incref ();
  29.   void decref ();
  30.   void binop ();
  31. + void *xmalloc ();
  32. + void *xrealloc ();
  33.   
  34.   main (argc, argv, env)
  35.        int argc;
  36. ***************
  37. *** 661,672 ****
  38. --- 668,681 ----
  39.     return getchar ();
  40.   }
  41.   
  42. + #ifndef __EMX__
  43.   void
  44.   fputchar (c)
  45.        char (c);
  46.   {
  47.     putchar (c);
  48.   }
  49. + #endif
  50.   
  51.   /* Read text from command input source up to a close-bracket,
  52.      make a string out of it, and return it.
  53. ***************
  54. *** 857,864 ****
  55. --- 866,875 ----
  56.   perror_with_name (name)
  57.        char *name;
  58.   {
  59. + #ifndef __EMX__
  60.     extern int errno, sys_nerr;
  61.     extern char *sys_errlist[];
  62. + #endif
  63.     char *s;
  64.   
  65.     if (errno < sys_nerr)
  66. ***************
  67. *** 887,908 ****
  68.   
  69.   /* Like malloc but get fatal error if memory is exhausted.  */
  70.   
  71. ! int
  72.   xmalloc (size)
  73.        int size;
  74.   {
  75. !   int result = malloc (size);
  76.     if (!result)
  77.       fatal ("virtual memory exhausted", 0);
  78.     return result;
  79.   }
  80.   
  81. ! int
  82.   xrealloc (ptr, size)
  83. !      char *ptr;
  84.        int size;
  85.   {
  86. !   int result = realloc (ptr, size);
  87.     if (!result)
  88.       fatal ("virtual memory exhausted");
  89.     return result;
  90. --- 898,919 ----
  91.   
  92.   /* Like malloc but get fatal error if memory is exhausted.  */
  93.   
  94. ! void *
  95.   xmalloc (size)
  96.        int size;
  97.   {
  98. !   void *result = malloc (size);
  99.     if (!result)
  100.       fatal ("virtual memory exhausted", 0);
  101.     return result;
  102.   }
  103.   
  104. ! void *
  105.   xrealloc (ptr, size)
  106. !      void *ptr;
  107.        int size;
  108.   {
  109. !   void *result = realloc (ptr, size);
  110.     if (!result)
  111.       fatal ("virtual memory exhausted");
  112.     return result;
  113.