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 tkchia Homepage, 18.09.2021, 21:16

Hello rosegondon, hello sezeros,

> 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
>


Whitespace issue (argh!). There is a tab character after the first #endif in the rejected patch portion --- you will need to edit the patch to add it in (or maybe change spaces into tabs).

Actually I think sezeros's patch throws away a bit too much code. The Unix-specific code (#ifdef unix ... #endif) tries to gather some bits of randomness by calling gettimeofday(...):

#ifdef unix
    FILE *rf;
    size_t ct;
   
        gettimeofday(&tv, (struct timezone *) NULL);
        trash[1] = tv.tv_sec;
        trash[2] = tv.tv_usec;
        ...
#define OS_KNOWN 1
#endif


... and DJGPP does support gettimeofday(...). Unfortunately, the patch will disable the code, which will reduce the amount of randomness the program can use. There is probably a better way...

Thank you!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

 

Complete thread:

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