home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / ftp.demon.co.uk-pub-cpm / redirbug.com / REDIRBUG.TXT < prev    next >
Text File  |  1996-04-08  |  2KB  |  56 lines

  1.     Fixing the redirection bug in Hi-Tech C
  2.     =======================================
  3.  
  4.     If you've tried to use the -R flag on the Hi-Tech C compiler to get I/O 
  5.     redirection (progname <infile >outfile) or automatic wildcard expansion 
  6.     you'll know it doesn't work - at link time the message 'Unknown 
  7.     symbol:' with no symbol name appears. This can be fixed by modifying 
  8.     your stdio.h and c.com files. In essence what you must do is to force 
  9.     the linking of getargs.obj from the library by making the symbol 
  10.     '__getargs' undefined.
  11.  
  12.     First, modify your stdio.h file so that it contains the following code 
  13.     (STDIO.DIF is included for those of you with DIF2 and SSED):
  14.  
  15.     #ifdef _REDIR
  16.     #asm
  17.     global __getargs
  18.     #endasm
  19.     #endif
  20.  
  21.     Now extract C.C from the library sources (HITECH3.LZH, in CPM.HUF; use 
  22.     the 'dehuff' program supplied, ie. 'dehuff -x cpm.huf c.c') and make 
  23.     the following changes: (or apply C.DIF with SSED)
  24.  
  25.     Line 40ish:
  26.  
  27.     before:
  28.       #define GETARGS "-U__getargs"
  29.     after:
  30.       #define CPPGET  "-D_REDIR"
  31.  
  32.     Line 160ish:
  33.  
  34.     before:
  35.       case 'R':
  36.               flgs[flg_idx++] = GETARGS;
  37.               break;
  38.     after:
  39.       case 'R':
  40.               iuds[iud_idx++] = CPPGET;
  41.               break;
  42.  
  43.     Recompile this new C.C (rename it as something else to avoid 
  44.     overwriting your current C.COM immediately) and replace your old C.COM 
  45.     with the new one thus created.
  46.  
  47.     Programs where redirection is required must contain the statement 
  48.     '#include <stdio.h>'.
  49.  
  50.     This method originally appeared in a message in comp.os.cpm in January 
  51.     1996, courtesy of Arnold Metselaar <metselr@fys.ruu.nl>.
  52.  
  53.     Jacob Nevins, 8/4/96
  54.     jacob@spuddy.mew.co.uk
  55.     also Jacob Nevins at 2:255/94 [CCBBS, (+44)-(0)1736-756633]
  56.