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 >
Wrap
Text File
|
1996-04-08
|
2KB
|
56 lines
Fixing the redirection bug in Hi-Tech C
=======================================
If you've tried to use the -R flag on the Hi-Tech C compiler to get I/O
redirection (progname <infile >outfile) or automatic wildcard expansion
you'll know it doesn't work - at link time the message 'Unknown
symbol:' with no symbol name appears. This can be fixed by modifying
your stdio.h and c.com files. In essence what you must do is to force
the linking of getargs.obj from the library by making the symbol
'__getargs' undefined.
First, modify your stdio.h file so that it contains the following code
(STDIO.DIF is included for those of you with DIF2 and SSED):
#ifdef _REDIR
#asm
global __getargs
#endasm
#endif
Now extract C.C from the library sources (HITECH3.LZH, in CPM.HUF; use
the 'dehuff' program supplied, ie. 'dehuff -x cpm.huf c.c') and make
the following changes: (or apply C.DIF with SSED)
Line 40ish:
before:
#define GETARGS "-U__getargs"
after:
#define CPPGET "-D_REDIR"
Line 160ish:
before:
case 'R':
flgs[flg_idx++] = GETARGS;
break;
after:
case 'R':
iuds[iud_idx++] = CPPGET;
break;
Recompile this new C.C (rename it as something else to avoid
overwriting your current C.COM immediately) and replace your old C.COM
with the new one thus created.
Programs where redirection is required must contain the statement
'#include <stdio.h>'.
This method originally appeared in a message in comp.os.cpm in January
1996, courtesy of Arnold Metselaar <metselr@fys.ruu.nl>.
Jacob Nevins, 8/4/96
jacob@spuddy.mew.co.uk
also Jacob Nevins at 2:255/94 [CCBBS, (+44)-(0)1736-756633]