Skip to content

Commit

Permalink
made to build under emx environment (tested working in my virtualbox.)
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Apr 17, 2024
1 parent dc7ee41 commit 54bdcd7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@

#include "common.h"

#ifdef __EMX__
#define INCL_DOS
#define INCL_KBD
#define INCL_VIO
#include <os2.h>
#include <stdlib.h>
#include <conio.h>
int kbhit (void) {
KBDKEYINFO k;
if (KbdPeek(&k, 0))
return 0;
return (k.fbStatus & KBDTRF_FINAL_CHAR_IN);
}
#endif
#if defined(_WIN32) || defined(__OS2__) || defined(__DJGPP__) || defined(_DOS)
#include <conio.h>
#endif
Expand Down Expand Up @@ -70,7 +84,7 @@ static int read_key(void)
char key;
int ret = 0;

#if defined(_WIN32) || defined(__OS2__) || defined(__DJGPP__) || defined(_DOS)
#if defined(_WIN32) || defined(__OS2__) || defined(__EMX__) || defined(__DJGPP__) || defined(_DOS)
if (kbhit()) {
key = getch();
ret = 1;
Expand Down

0 comments on commit 54bdcd7

Please sign in to comment.