[sane-devel] [PATCH] undefined symbols in the qcam backend on
GNU/kFreeBSD
Aurelien Jarno
aurelien at aurel32.net
Sat Jan 7 04:15:47 UTC 2006
Hi,
Please find below a patch to the qcam backend to fix undefined symbols
at runtime when dlopening the symbols on GNU/kFreeBSD (GNU libc with a
FreeBSD kernel).
This platform uses a GNU libc, so <sys/io.h> is available. However the
check in the source code is done on __linux__ and not on __GLIBC__.
I would even change the line to
#if defined(HAVE_SYS_IO_H) || defined(HAVE_ASM_IO_H) || defined(HAVE_SYS_HW_H)
but they may have systems where one of those is defined and the where
the associated functions inb and outb functions are not defined.
Thanks,
Aurelien
--- sane-backends-1.0.17.orig/backend/qcam.c.orig 2006-01-07 04:29:14.000000000 +0100
+++ sane-backends-1.0.17/backend/qcam.c 2006-01-07 04:29:45.000000000 +0100
@@ -193,10 +193,10 @@
static const SANE_Range bw_y_range = { 0, 241, 1 };
static const SANE_Range odd_bw_y_range = { 1, 242, 1 };
-#if defined(__linux__) || defined (HAVE_SYS_HW_H)
+#if defined(__GLIBC__) || defined (HAVE_SYS_HW_H)
#ifdef HAVE_SYS_IO_H
-# include <sys/io.h> /* GNU libc based Linux */
+# include <sys/io.h> /* GNU libc based OS */
#elif HAVE_ASM_IO_H
# include <asm/io.h> /* older Linux */
#elif HAVE_SYS_HW_H
@@ -209,7 +209,7 @@
#define write_lpdata(d,v) outb ((v), (d)->port)
#define write_lpcontrol(d,v) outb ((v), (d)->port + 2)
-#endif /* __linux__ */
+#endif /* __GLIBC__ */
static SANE_Status
enable_ports (QC_Device * q)
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32 at debian.org | aurelien at aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
More information about the sane-devel
mailing list