1 [PATCH] backend/qcam.c: fix build on !x86
3 inb/outb/ioperm are x86 specific interfaces, so replace with noops on
6 Inspired by similar patch in openwrt:
7 https://dev.openwrt.org/ticket/5689
9 Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
11 backend/qcam.c | 14 +++++++++++++-
12 1 file changed, 13 insertions(+), 1 deletion(-)
14 Index: sane-backends-1.0.22/backend/qcam.c
15 ===================================================================
16 --- sane-backends-1.0.22.orig/backend/qcam.c
17 +++ sane-backends-1.0.22/backend/qcam.c
20 #endif /* <sys/io.h> || <asm/io.h> || <sys/hw.h> */
22 +/* inb / outb only exist on x86 */
23 +#if defined(__i386__) || defined(__x86_64__)
24 #define read_lpdata(d) inb ((d)->port)
25 #define read_lpstatus(d) inb ((d)->port + 1)
26 #define read_lpcontrol(d) inb ((d)->port + 2)
27 #define write_lpdata(d,v) outb ((v), (d)->port)
28 #define write_lpcontrol(d,v) outb ((v), (d)->port + 2)
31 +#define read_lpdata(d) 0
32 +#define read_lpstatus(d) 0
33 +#define read_lpcontrol(d) 0
34 +#define write_lpdata(d,v)
35 +#define write_lpcontrol(d,v)
39 enable_ports (QC_Device * q)
41 if (q->port < 0x278 || q->port > 0x3bc)
42 return SANE_STATUS_INVAL;
44 +#if defined(__i386__) || defined(__x86_64__)
45 if (ioperm (q->port, 3, 1) < 0)
46 return SANE_STATUS_INVAL;
49 return SANE_STATUS_GOOD;
53 disable_ports (QC_Device * q)
55 +#if defined(__i386__) || defined(__x86_64__)
56 if (ioperm (q->port, 3, 0) < 0)
57 return SANE_STATUS_INVAL;
60 return SANE_STATUS_GOOD;