summaryrefslogtreecommitdiff
path: root/audio/buzztard/patches/patch-aa
blob: aac03ab38bcb29ca8557fcd26a868306c9961236 (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
$NetBSD: patch-aa,v 1.1.1.1 2009/09/10 20:16:45 wiz Exp $

--- src/lib/ic/input-device.c.orig	2008-08-11 16:59:42.000000000 +0000
+++ src/lib/ic/input-device.c
@@ -44,7 +44,9 @@
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef __Linux__
 #include <linux/input.h>
+#endif
 
 enum {
   DEVICE_DEVNODE=1
@@ -70,6 +72,7 @@ static GObjectClass *parent_class=NULL;
 #define test_bit(bit, array)    (array[bit>>3] & (1<<(bit&0x7)))
 
 static gboolean register_trigger_controls(const BtIcInputDevice * const self,int fd) {
+#ifdef __Linux__
   BtIcTriggerControl *control;
   guint ix;
   guint8 key_bitmask[KEY_MAX/8 + 1];
@@ -152,10 +155,12 @@ static gboolean register_trigger_control
       }
     }
   }
+#endif
   return(TRUE);
 }
 
 static gboolean register_abs_range_controls(const BtIcInputDevice * const self,int fd) {
+#ifdef __Linux__
   BtIcAbsRangeControl *control;
   guint ix;
   guint8 abs_bitmask[ABS_MAX/8 + 1];
@@ -220,10 +225,12 @@ static gboolean register_abs_range_contr
     }
   }
   // create controller instances and register them
+#endif
   return(TRUE);
 }
 
 static gboolean register_controls(const BtIcInputDevice * const self) {
+#ifdef __Linux__
   int fd;
   guint ix;
   guint8 evtype_bitmask[EV_MAX/8 + 1];
@@ -280,12 +287,14 @@ static gboolean register_controls(const 
   }
 
   close(fd);
+#endif
   return(TRUE);
 }
 
 //-- handler
 
 static gboolean io_handler(GIOChannel *channel,GIOCondition condition,gpointer user_data) {
+#ifdef __Linux__
   BtIcInputDevice *self=BTIC_INPUT_DEVICE(user_data);
   BtIcControl *control;
   GError *error=NULL;
@@ -326,6 +335,9 @@ static gboolean io_handler(GIOChannel *c
     self->priv->io_source=-1;
   }
   return(res);
+#else
+  return(FALSE);
+#endif
 }
 
 //-- constructor methods