I have inherited some code that was first written in the mid 1980s, and last updated in 1993.
It takes a data file that our flagship program creates and plots it then prints out the plot. It's been great, and is a nice thing for our more frugal customers who don't want fancy graphics and are just wanting to give their customer a printout when the job is over. It's worked since DOS in all the versions of Windows we 're tried, till now.
However, it does not work in Windows 7.
And sadly, our customers want to run Windows 7. So...
So it needs a re-write, or maybe we'll strip out the code that does the plotting and add it to our flagship program. I got handed the job. The guy that wrote it originally is no longer around.
I figured, and perhaps this is wrong, that I should compile what's there, and then start looking at it and seeing what does what and what I need to change to get it to work in Windows 7.
I am using Borland's bcc55 command line compiler because my boss is fairly sure that the guy that worked on it last used Borland's compiler, and this was free.
I am getting some odd errors.
In butil.h, line 397 I get an "error E2293 ) expected". But it's not. And there's not one missing above it. And then I get the same error on line 432. The code from 397 to 434 is this:
Code:
void cdecl utamove ((char far *),(char far *),(unsigned int),(int)); /* Copy memory from far pointer */ /*char far *, source to far pointer target.*/
/*unsigned int, Does not handle overlap. */
/*int); /* */
// replaced with code from newer butil.h from 1988
//void cdecl utamove(const char far *,/* Copy memory from far pointer */
// char far *, /* source to far pointer target.*/
// unsigned int, /* Does not handle overlap. */
// int); /* */
/* */
/* */
int cdecl utctlbrk (int,int); /* Set or return state of DOS */
/* CTRL-BREAK checking. */
/* */
#ifndef utdosver /* */
int cdecl utdosver (void); /* Return the DOS major, minor */
#endif /* version number as 16-bit. */
/* */
int cdecl utgetclk (long *); /* Return the BIOS clock roll */
/* flag and tick count. */
/* */
int cdecl utintflg (int); /* Set interrupt state, return */
/* old state. */
/* */
unsigned int cdecl utnulchk (void); /* Check for NIL-pointer */
/* assignments. */
/* */
unsigned cdecl utsleep (unsigned); /* Suspend processing for */
/* specified duration. */
/* */
void cdecl utspkr (unsigned); /* Speaker control. */
/* */
void cdecl utmovmem (char far *, char far *,unsigned int); /* Copy block of memory, using */
/*char far *, /* far pointer source and */
/*unsigned int); /* target. */
Any thoughts?
I thought at first that it was something to do with the char far * as I am also getting the same error message in asych_1.h in lines 53 and 82, and the only common thing is that all of them are using far. Here's that code:
Code:
int cdecl iscom_a1(int,unsigned *,unsigned *,char far **); /* Open a COM port */
int cdecl open_a1(int,int,int,int,int,char *);
int cdecl close_a1(int); /* Close a COM port */
/* Write a block */
int cdecl wrtbk_a1(int,int,char,char *,int *);
/* Write a string */
int cdecl wrtst_a1(int,int,char *,int *);
int cdecl wrtch_a1(int,char); /* Write a character */
/* Read a character */
int cdecl rdch_a1(int,char *,int *,unsigned *);
/* Read a string */
int cdecl rdst_a1(int,int,char *,int *,int *,unsigned *);
/* Read a block */
int cdecl rdbk_a1(int,int,char,char *,int *,int *,unsigned *);
/* Return input queue size */
int cdecl qsize_a1(int,int *,unsigned *);
int cdecl oqsiz_a1(int,int *); /* Return output queue size */
int cdecl setop_a1(int,int,int); /* Set transmission options */
int cdecl retop_a1(int,int,int *); /* Return transmission options */
int cdecl oflsh_a1(int); /* Flush the output queue */
int cdecl iflsh_a1(int); /* Flush the input queue */
int cdecl break_a1(int); /* Send a break signal */
/* BIOS initialization of a port*/
int cdecl init_a1(int,int,int,int,int,int *,int *);
int cdecl stat_a1(int,int *,int *); /* BIOS return of COM status */
int cdecl rcvch_a1(int,char *); /* BIOS read a character */
int cdecl sndch_a1(int,char); /* BIOS send a character */
/* Return the busy flag */
int cdecl bflag_a1(int,int *,int far **);
So I added
Code:
#ifdef FAR #undef FAR
#endif /* end #ifdef FAR */
// define FAR to be nothing just to satisfy the compiler
#define FAR
before the bits of code, thinking maybe it just didn't know what far was, but that didn't do a dang thing.
So, any ideas?
I have counted the number of open and close parenthesis multiple times and keep getting an even number, and can't see where there are any missing.
Both butil.h and async_1 .h are from Blaise Computing Inc. in the mid 1980s. I was able to find a newer version of butil.h, but ran into the same problem with it.
Any thoughts?
I'm sure it's something easy, but I am having a bit of a brain fart, and it's been 12+ years since I did any C, so maybe that's just it.
Any help at all is appreciated,
Thanks,
-Mike