summaryrefslogtreecommitdiff
path: root/games/moria/patches/patch-ad
blob: 3ddba32b3f1aa28df1fabf2786763113e66520fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
$NetBSD: patch-ad,v 1.3 2007/03/06 23:25:48 rillig Exp $
--- source/io.c.orig	1994-07-22 03:47:26.000000000 +0200
+++ source/io.c	2007-03-07 00:06:06.234247718 +0100
@@ -90,12 +90,19 @@ typedef struct { int stuff; } fpvmach;
 #include <sys/types.h>
 #endif
 
+#if (defined(BSD) && BSD >= 199306)	/* XXX for all post 1993 BSDs? */
+#include <sgtty.h>
+#endif
+
 #ifdef USG
 #ifndef ATARI_ST
 #include <string.h>
 #else
 #include "string.h"
 #endif
+#if defined(__linux)
+#  include <termios.h>
+#endif
 #if 0
 /* Used to include termio.h here, but that caused problems on some systems,
    as curses.h includes it also above.  */
@@ -245,7 +252,7 @@ int suspend()
   struct ltchars lcbuf;
   struct tchars cbuf;
   int lbuf;
-  long time();
+  time_t time();
 
   py.misc.male |= 2;
   (void) ioctl(0, TIOCGETP, (char *)&tbuf);
@@ -331,7 +338,7 @@ void init_curses()
 #if defined(atarist) && defined(__GNUC__)
   (void) signal (SIGTSTP, (__Sigfunc)suspend);
 #else
-#ifdef  __386BSD__
+#if defined(__386BSD__) || (defined(BSD) && BSD >= 199306)
   (void) signal (SIGTSTP, (sig_t)suspend);
 #else
   (void) signal (SIGTSTP, suspend);
@@ -419,7 +426,7 @@ void moriaterm()
   init_color (3,1000, 500,   0);	/* pen 3 - orange */
 #else
 #if !defined(ATARI_ST) && !defined(VMS)
-#ifdef USG
+#if defined(USG) && defined(VINTR)
   (void) ioctl(0, TCGETA, (char *)&tbuf);
   /* disable all of the normal special control characters */
   tbuf.c_cc[VINTR] = (char)3; /* control-C */
@@ -527,6 +534,7 @@ void restore_term()
 }
 #else
 {
+  int y, x;
 #ifdef AMIGA
   closetimer ();
 #endif
@@ -542,7 +550,8 @@ void restore_term()
   pause_line(15);
 #endif
   /* this moves curses to bottom right corner */
-  mvcur(stdscr->_cury, stdscr->_curx, LINES-1, 0);
+  getyx(stdscr, y, x);
+  mvcur(y, x, LINES-1, 0);
   endwin();  /* exit curses */
   (void) fflush (stdout);
 #ifdef MSDOS
@@ -757,7 +766,7 @@ void shell_out()
       msg_print("Fork failed. Try again.");
       return;
     }
-#if defined(USG) || defined(__386BSD__)
+#if defined(USG) || defined(__386BSD__) || (defined(BSD) && BSD >= 199306)
   (void) wait((int *) 0);
 #else
   (void) wait((union wait *) 0);