[Xcb] problem with compiling xcb1.0

Barton C Massey bart at cs.pdx.edu
Sun Aug 12 17:23:47 PDT 2007


In message <33fc52180708120420j3d7f6c13k46e0b2dfaec7843a at mail.gmail.com> you wrote:
> > > xcb_util.c:193: error: `AI_NUMERICHOST' undeclared (first use in this
> > > function)
> > > xcb_util.c:194: error: `AF_INET6' undeclared (first use in this
> > function)
> 
> Thanks for the quick response, the latest version from git did solve one the
> errors, but those two above still exist.

Attached is a patch that will probably get you compiling.
It's obviously the wrong thing---some effort should be made
to track down the places those symbols can come from and
fold the resulting information into configure.ac.  Anybody
know whether there's a predefined set of IPV6 stuff in
autoconf?

	Bart

-------------- next part --------------
diff --git a/src/xcb_auth.c b/src/xcb_auth.c
index ffc0515..3f24690 100644
--- a/src/xcb_auth.c
+++ b/src/xcb_auth.c
@@ -93,6 +93,7 @@ static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen,
     family = FamilyLocal; /* 256 */
     switch(sockname->sa_family)
     {
+#ifdef AF_INET6
     case AF_INET6:
         addr = (char *) SIN6_ADDR(sockname);
         addrlen = sizeof(*SIN6_ADDR(sockname));
@@ -104,6 +105,7 @@ static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen,
         }
         addr += 12;
         /* if v4-mapped, fall through. */
+#endif
     case AF_INET:
         if(!addr)
             addr = (char *) &((struct sockaddr_in *)sockname)->sin_addr;
@@ -179,6 +181,7 @@ static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr *
 	    APPEND(info->data, j, si->sin_port);
 	}
 	break;
+#ifdef AF_INET6
         case AF_INET6:
             /*block*/ {
             struct sockaddr_in6 *si6 = (struct sockaddr_in6 *) sockname;
@@ -199,6 +202,7 @@ static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr *
             }
         }
         break;
+#endif
         case AF_UNIX:
             /*block*/ {
 	    uint32_t fakeaddr = htonl(0xffffffff - next_nonce());
diff --git a/src/xcb_util.c b/src/xcb_util.c
index dd2305a..3eacc0d 100644
--- a/src/xcb_util.c
+++ b/src/xcb_util.c
@@ -216,6 +216,7 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port)
     if (protocol && strcmp("tcp",protocol))
         return -1;
 
+#ifdef AF_INET6
     /* Allow IPv6 addresses enclosed in brackets. */
     if(host[0] == '[' && (bracket = strrchr(host, ']')) && bracket[1] == '\0')
     {
@@ -224,6 +225,7 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port)
         hints.ai_flags |= AI_NUMERICHOST;
         hints.ai_family = AF_INET6;
     }
+#endif
 
     snprintf(service, sizeof(service), "%hu", port);
     if(getaddrinfo(host, service, &hints, &results))


More information about the Xcb mailing list