summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/network/TcpSocket.cxx4
-rw-r--r--configure.ac1
2 files changed, 3 insertions, 2 deletions
diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx
index 75d388d9..8bd817c4 100644
--- a/common/network/TcpSocket.cxx
+++ b/common/network/TcpSocket.cxx
@@ -364,10 +364,10 @@ TcpListener::TcpListener(const char *listenaddr, int port, bool localhostOnly,
if (localhostOnly) {
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
} else if (listenaddr != NULL) {
-#ifndef WIN32
+#ifdef HAVE_INET_ATON
if (inet_aton(listenaddr, &addr.sin_addr) == 0)
#else
- /* Windows doesn't have inet_aton, sigh */
+ /* Some systems (e.g. Windows) do not have inet_aton, sigh */
if ((addr.sin_addr.s_addr = inet_addr(listenaddr)) == INADDR_NONE)
#endif
{
diff --git a/configure.ac b/configure.ac
index 11311c54..56001541 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,6 +138,7 @@ AC_CHECK_FUNCS([vsnprintf snprintf strcasecmp strncasecmp])
# Network functions
AC_SEARCH_LIBS([inet_aton], [resolv])
+AC_CHECK_FUNCS([inet_aton])
# IPv6 related functions
AC_CHECK_FUNCS([inet_ntop getaddrinfo])