summaryrefslogtreecommitdiff
path: root/games/rocksndiamonds/patches/patch-ag
blob: 758bf0df842aa06d5f9d6b5eb5afd96c3e12ab81 (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
$NetBSD: patch-ag,v 1.4 2005/08/16 15:35:51 adam Exp $

--- src/libgame/joystick.c.orig	2005-07-23 19:10:58.000000000 +0000
+++ src/libgame/joystick.c
@@ -11,12 +11,13 @@
 * joystick.c                                               *
 ***********************************************************/
 
-#if defined(PLATFORM_FREEBSD)
+#include "misc.h"
+
+#if defined(PLATFORM_FREEBSD) || (defined(PLATFORM_NETBSD) && defined(HAVE_JOYSTICK))
 #include <machine/joystick.h>
 #endif
 
 #include "joystick.h"
-#include "misc.h"
 
 
 /* ========================================================================= */
@@ -68,7 +69,7 @@ void UnixInitJoysticks()
 
 boolean UnixReadJoystick(int fd, int *x, int *y, boolean *b1, boolean *b2)
 {
-#if defined(PLATFORM_FREEBSD)
+#if defined(PLATFORM_FREEBSD) || (defined(PLATFORM_NETBSD) && defined(HAVE_JOYSTICK))
   struct joystick joy_ctrl;
 #else
   struct joystick_control
@@ -87,7 +88,7 @@ boolean UnixReadJoystick(int fd, int *x,
   if (y != NULL)
     *y = joy_ctrl.y;
 
-#if defined(PLATFORM_FREEBSD)
+#if defined(PLATFORM_FREEBSD) || (defined(PLATFORM_NETBSD) && defined(HAVE_JOYSTICK))
   if (b1 != NULL)
     *b1 = joy_ctrl.b1;
   if (b2 != NULL)