summaryrefslogtreecommitdiff
path: root/games/plib/patches/patch-ab
blob: 47eeef0b63fbac8efc223302c3a8b236928218ff (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
$NetBSD: patch-ab,v 1.1.1.1 2000/02/19 22:32:45 rh Exp $

--- src/js/js.h.orig	Sat Oct 16 23:08:01 1999
+++ src/js/js.h	Sat Feb 19 22:26:37 2000
@@ -29,7 +29,7 @@
 #  include <unistd.h>
 #  include <fcntl.h>
 
-#  ifdef __FreeBSD__
+#  if defined(__FreeBSD__) || defined(__NetBSD__)
 #    include <machine/joystick.h>
 #    define JS_DATA_TYPE joystick
 #    define JS_RETURN (sizeof(struct JS_DATA_TYPE))
@@ -76,7 +76,7 @@
 #ifdef WIN32
 #  define _JS_MAX_AXES 6
 #else
-#  ifdef __FreeBSD__
+#  if defined(__FreeBSD__) || defined(__NetBSD__)
 #  define _JS_MAX_AXES 2
 #  else
 #  define _JS_MAX_AXES 6
@@ -85,7 +85,7 @@
 
 class jsJoystick
 {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
   int          id ;
 #endif
 #ifdef WIN32
@@ -153,7 +153,7 @@
     }
 
 #else
-#  ifdef __FreeBSD__
+#  if defined(__FreeBSD__) || defined(__NetBSD__)
     FILE *joyfile;
     char joyfname[1024];
     int noargs, in_no_axes;
@@ -178,7 +178,7 @@
     if ( error )
       return ;
 
-#  ifdef __FreeBSD__
+#  if defined(__FreeBSD__) || defined(__NetBSD__)
 
     float axes[_JS_MAX_AXES];
     int buttons[_JS_MAX_AXES];
@@ -316,7 +316,7 @@
       default :    num_axes = 0 ; setError () ; break ;
     }
 #else
-#  ifdef __FreeBSD__
+#  if defined(__FreeBSD__) || defined(__NetBSD__)
     id = ident;
     sprintf ( fname, "/dev/joy%d", ident ) ;
 #  else
@@ -467,7 +467,7 @@
     }
 
     if ( buttons )
-#  ifdef __FreeBSD__
+#  if defined(__FreeBSD__) || defined(__NetBSD__)
       *buttons = ( js.b1 ? 1 : 0 ) | ( js.b2 ? 2 : 0 ) ;
 #  else
       *buttons = js.buttons ;