]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ipaddr/ng_ipaddr.c
Make configure[.ng] compatible with autoconf 1.10 again
[ngircd-alex.git] / src / ipaddr / ng_ipaddr.c
index af524d091fa569dd874559a3f032f5dcc0cfde6d..9cf35ec976325f312dc30672ad8e8fc417b96e90 100644 (file)
@@ -1,11 +1,14 @@
 /*
- * Functions for AF_ agnostic ipv4/ipv6 handling.
- *
  * (c) 2008 Florian Westphal <fw@strlen.de>, public domain.
  */
 
 #include "portab.h"
 
+/**
+ * @file
+ * Functions for AF_ agnostic ipv4/ipv6 handling.
+ */
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
@@ -29,7 +32,9 @@ ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port)
        assert(ip_str);
 
        memset(&hints, 0, sizeof(hints));
+#ifdef AI_NUMERICHOST
        hints.ai_flags = AI_NUMERICHOST;
+#endif
 #ifndef WANT_IPV6      /* do not convert ipv6 addresses */
        hints.ai_family = AF_INET;
 #endif
@@ -44,8 +49,8 @@ ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port)
        if (ret != 0)
                return false;
 
-       assert(sizeof(*addr) >= res0->ai_addrlen);
-       if (sizeof(*addr) >= res0->ai_addrlen)
+       assert(sizeof(*addr) >= (size_t)res0->ai_addrlen);
+       if (sizeof(*addr) >= (size_t)res0->ai_addrlen)
                memcpy(addr, res0->ai_addr, res0->ai_addrlen);
        else
                ret = -1;