Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

How to compile this program for DOS? (Developers)

posted by rosegondon, C:\DOS, 18.09.2021, 18:37

patch.exe from UnxUtils failed, same for patch.exe from Perl for Windows.

Error message:

patching file otp.c
Hunk #2 FAILED at 193.
patch unexpectedly ends in middle of line
Hunk #3 succeeded at 344 with fuzz 2.
1 out of 3 hunks FAILED -- saving rejects to file otp.c.rej


otp.c.rej contents:

***************
*** 189,195 ****
  #ifdef MSDOS
      union _REGS ri, ro;
  #endif
- #ifdef unix
      struct timeval tv;
  #endif
     
--- 193,199 ----
  #ifdef MSDOS
      union _REGS ri, ro;
  #endif
+ #if defined(unix) && !defined(__DJGPP)
      struct timeval tv;
  #endif
     


> If you patch it like the following, it does compile.
> (Not run-tested at all, though.)
>
>
> --- otp.c~
> +++ otp.c
> @@ -55,8 +55,12 @@
> #ifdef WIN32
> #include <windows.h>
> #endif
> -
> -#ifdef unix
> +#ifdef __DJGPP
> +#define __far
> +#define _intdos intdos
> +#define _REGS REGS
> +#endif
> +#if defined(unix) && !defined(__DJGPP)
> #include <sys/time.h>
> extern int getpid(), getppid(), gethostid();
> #endif
> @@ -189,7 +193,7 @@
> #ifdef MSDOS
> union _REGS ri, ro;
> #endif       
> -#ifdef unix
> +#if defined(unix) && !defined(__DJGPP)
> struct timeval tv;
> #endif
>
> @@ -340,7 +344,7 @@
> #define OS_KNOWN 1
> #endif
>
> -#ifdef unix
> +#if defined(unix) && !defined(__DJGPP)
> FILE *rf;
> size_t ct;
>

---
echo g=ffff:0|debug>nul

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 183 users online (0 registered, 183 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum