[sane-devel] problems with CVS-code on OS/2
Julien BLACHE
jb@jblache.org
Mon, 31 Mar 2003 17:31:51 +0200
--=-=-=
"Franz Bakan" <fbakan@gmx.net> wrote:
Hi,
> 1. saned:
> saned.c:60:22: sys/poll.h: No such file or directory
>
> If I remove this include saned compiles.
Should be included only if saned uses AF-indep code, patch attached.
JB.
--
Julien BLACHE <http://www.jblache.org>
<jb@jblache.org>
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=poll.h.patch
Content-Description: do not include poll.h if not using AF-indep
diff -u sane-backends/frontend/saned.c sane-backends/frontend/saned.c
--- sane-backends/frontend/saned.c 2003-03-30 20:42:43.000000000 +0200
+++ sane-backends/frontend/saned.c 2003-03-31 17:29:17.000000000 +0200
@@ -32,6 +32,12 @@
#include "../include/lalloca.h"
#include "../include/sys/types.h"
+#if defined(HAVE_GETADDRINFO) && defined (HAVE_GETNAMEINFO)
+# define SANED_USES_AF_INDEP
+#else
+# undef ENABLE_IPV6
+#endif /* HAVE_GETADDRINFO && HAVE_GETNAMEINFO */
+
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
@@ -57,7 +63,9 @@
#include <sys/param.h>
#include <sys/socket.h>
-#include <sys/poll.h>
+#ifdef SANED_USES_AF_INDEP
+# include <sys/poll.h>
+#endif /* SANED_USES_AF_INDEP */
#include <sys/time.h>
#include <sys/types.h>
#include <arpa/inet.h>
@@ -92,12 +100,6 @@
#define SANED_CONFIG_FILE "saned.conf"
-#if defined(HAVE_GETADDRINFO) && defined (HAVE_GETNAMEINFO)
-# define SANED_USES_AF_INDEP
-#else
-# undef ENABLE_IPV6
-#endif /* HAVE_GETADDRINFO && HAVE_GETNAMEINFO */
-
typedef struct
{
u_int inuse:1; /* is this handle in use? */
--=-=-=--