File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ CC = dmc
2424
2525CHTYPE = -DCHTYPE_32
2626
27- CFLAGS = -c -o+space -Nc -mld -DDOS
28- # CFLAGS = -c -o+space -Nc -mld -DDOS
27+ CFLAGS = -c -o+space -Nc
2928
30- CPPFLAGS = -I$(PDCURSES_SRCDIR) -msd $(CHTYPE)
29+ CPPFLAGS = -I$(PDCURSES_SRCDIR) -DDOS -mld $(CHTYPE)
3130
3231LINK = dmc
3332LIBEXE = lib
@@ -60,7 +59,7 @@ scanw.obj scr_dump.obj scroll.obj slk.obj termattr.obj terminfo.obj \
6059touch.obj util.obj window.obj debug.obj
6160
6261PDCOBJS = pdcclip.obj pdcdisp.obj pdcgetsc.obj pdckbd.obj pdcscrn.obj \
63- pdcsetsc.obj pdcutil.obj
62+ pdcsetsc.obj pdcutil.obj getch2.obj
6463
6564DEMOOBS = calendar.obj firework.obj init_col.obj mbrot.obj \
6665newtest.obj ozdemo.obj picsview.obj ptest.obj rain.obj speed.obj \
@@ -225,6 +224,9 @@ pdcsetsc.obj: $(osdir)\pdcsetsc.c
225224pdcutil.obj: $(osdir)\pdcutil.c
226225 $(OSBUILD)
227226
227+ getch2.obj: getch2.c
228+ $(OSBUILD)
229+
228230calendar.exe: $(demodir)\calendar.c
229231 $(DEMOBUILD)
230232
Original file line number Diff line number Diff line change 1+ #include <conio.h>
2+
3+ /* Both the curses library and the Digital Mars runtime library have
4+ functions called int getch( void). With the following, code in pdckbd.c
5+ can call dmc_getch() and get the DMC library version. It is used _only_
6+ with Digital Mars; other compilers don't have the name collision. */
7+
8+ int dmc_getch ( )
9+ {
10+ return ( _getch ( ));
11+ }
Original file line number Diff line number Diff line change 1-
21#include <stdio.h>
32#include <string.h>
43#include <stdlib.h>
1514#include "pdcvt.h"
1615#include "../common/mouse.c"
1716
18- #if defined( __BORLANDC__ ) || defined( DOS )
17+ #if defined( __BORLANDC__ )
1918 #define WINDOWS_VERSION_OF_KBHIT kbhit
2019#else
2120 #define WINDOWS_VERSION_OF_KBHIT _kbhit
2221#endif
2322
23+ #ifdef __DMC__
24+ int dmc_getch ( void ); /* see 'getch2.c' */
25+ #endif
26+
2427/* Modified from the accepted answer at
2528
2629https://stackoverflow.com/questions/33025599/move-the-cursor-in-a-c-program
@@ -81,7 +84,11 @@ static bool check_key( int *c)
8184 {
8285 rval = TRUE;
8386 if ( c )
87+ #ifdef __DMC__
88+ * c = dmc_getch ( ); /* see 'getch2.c' */
89+ #else
8490 * c = _getch ( );
91+ #endif
8592 }
8693 else
8794 rval = FALSE;
You can’t perform that action at this time.
0 commit comments