configure.in (AC_CHECK_HEADERS): Look for <arpa/inet.h>.
(AC_CHECK_FUNCS): Look for inet_aton().
src/compat.c: Try to include <arpa/inet.h> so we get inet_addr().
(getaddrinfo): If inet_aton() is not provided, use inet_addr() instead.
src/compat.h (AI_NUMERICHOST): Define this too.
src/tools.c (irc_pton): Use the pedantically correct type for ip4.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-30
# arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
#
+2006-09-03 15:24:48 GMT Michael Poole <mdpoole@troilus.org> patch-30
+
+ Summary:
+ Make srvx compile on cygwin again.
+ Revision:
+ srvx--devo--1.3--patch-30
+
+ configure.in (AC_CHECK_HEADERS): Look for <arpa/inet.h>.
+ (AC_CHECK_FUNCS): Look for inet_aton().
+
+ src/compat.c: Try to include <arpa/inet.h> so we get inet_addr().
+ (getaddrinfo): If inet_aton() is not provided, use inet_addr() instead.
+
+ src/compat.h (AI_NUMERICHOST): Define this too.
+
+ src/tools.c (irc_pton): Use the pedantically correct type for ip4.
+
+ modified files:
+ ChangeLog configure.in src/compat.c src/compat.h src/tools.c
+
+
2006-09-03 15:21:10 GMT Michael Poole <mdpoole@troilus.org> patch-29
Summary:
AC_STRUCT_TM
dnl Would rather not bail on headers, BSD has alot of the functions elsewhere. -Jedi
-AC_CHECK_HEADERS(fcntl.h malloc.h netdb.h netinet/in.h sys/resource.h sys/timeb.h sys/times.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h unistd.h getopt.h memory.h regex.h arpa/inet.h sys/mman.h sys/stat.h dirent.h,,)
+AC_CHECK_HEADERS(fcntl.h malloc.h netdb.h arpa/inet.h netinet/in.h sys/resource.h sys/timeb.h sys/times.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h unistd.h getopt.h memory.h regex.h arpa/inet.h sys/mman.h sys/stat.h dirent.h,,)
dnl portability stuff, hurray! -Jedi
AC_CHECK_MEMBER([struct sockaddr.sa_len],
fi
dnl We have fallbacks in case these are missing, so just check for them.
-AC_CHECK_FUNCS(freeaddrinfo getaddrinfo getnameinfo getpagesize memcpy memset strdup strerror strsignal localtime_r setrlimit getopt getopt_long regcomp regexec regfree sysconf,,)
+AC_CHECK_FUNCS(freeaddrinfo getaddrinfo getnameinfo getpagesize memcpy memset strdup strerror strsignal localtime_r setrlimit getopt getopt_long regcomp regexec regfree sysconf inet_aton,,)
dnl Check for absolutely required library functions.
AC_CHECK_FUNCS(select socket strcspn strspn strtod strtoul,,AC_MSG_ERROR([a required function was not found. srvx build will fail.]))
#ifdef HAVE_MEMORY_H
# include <memory.h>
#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
#if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_FTIME)
extern gettimeofday(struct timeval * tv, struct timezone * tz);
if (node) {
if (hints && hints->ai_flags & AI_NUMERICHOST) {
+#if HAVE_INET_ATON
if (!inet_aton(node, &sin.sin_addr))
return 2;
+#else
+ sin.sin_addr.s_addr = inet_addr(node);
+ if (sin.sin_addr.s_addr == INADDR_NONE)
+ return 2;
+#endif
} else {
struct hostent *he;
he = gethostbyname(node);
#define AI_PASSIVE 1
#define AI_CANONNAME 2
+#define AI_NUMERICHOST 4
#endif /* !defined(HAVE_STRUCT_ADDRINFO) */
addr->in6[cpos + jj] = 0;
}
} else if (dot) {
- unsigned int ip4;
+ uint32_t ip4;
pos = irc_pton_ip4(input, bits, &ip4);
if (pos) {
addr->in6[5] = htons(65535);