Hello,
While porting SANE to OpenWRT, I needed to patch SANE in order to compile
it using musl (default libc in OpenWRT trunk). The problem is that u_char
and u_long was not defined. glibc seems to be fine without it.
The fix is quite simple: I added '#include <sys/types.h>' to these files:
/include/sane/sanei_udp.h
/backend/kvs20xx_cmd.h
/backend/kvs40xx.h
/backend/hp5400.c
/backend/hp5590.c
I have the patch (attached) for it but it is based on 1.0.24.
Is this the best solution?
Also, I would be interesting to have a fix upstream.
Regards,
--- a/include/sane/sanei_udp.h
+++ b/include/sane/sanei_udp.h
@@ -27,6 +27,7 @@
#include <netinet/in.h>
#include <netdb.h>
#endif
+#include <sys/types.h>
extern SANE_Status sanei_udp_open(const char *host, int port, int *fdp);
extern SANE_Status sanei_udp_open_broadcast(int *fdp);
--- a/backend/kvs20xx_cmd.h
+++ b/backend/kvs20xx_cmd.h
@@ -9,6 +9,8 @@
Panasonic KV-S20xx USB-SCSI scanners.
*/
+#include <sys/types.h>
+
#define COMMAND_BLOCK 1
#define DATA_BLOCK 2
#define RESPONSE_BLOCK 3
--- a/backend/kvs40xx.h
+++ b/backend/kvs40xx.h
@@ -10,6 +10,7 @@
#include "../include/sane/config.h"
#include <semaphore.h>
+#include <sys/types.h>
#undef BACKEND_NAME
#define BACKEND_NAME kvs40xx
--- a/backend/hp5400.c
+++ b/backend/hp5400.c
@@ -67,6 +67,7 @@
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memcpy */
#include <stdio.h>
+#include <sys/types.h>
#define HP5400_CONFIG_FILE "hp5400.conf"
--- a/backend/hp5590.c
+++ b/backend/hp5590.c
@@ -48,6 +48,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <sys/types.h>
#include "../include/sane/sane.h"
#define BACKEND_NAME hp5590
--
sane-devel mailing list: [email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to [email protected]