diff options
author | Pierre Ossman <ossman@cendio.se> | 2010-02-12 09:19:32 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2010-02-12 09:19:32 +0000 |
commit | 4065997c5e952ef25e34b021bdd4eb00a4e79839 (patch) | |
tree | 64e726d73d73d43821ffc79c5f07a909fd1f0b53 | |
parent | 657806f8fe2b2156797c68fd03c717ea487688b2 (diff) | |
download | tigervnc-4065997c5e952ef25e34b021bdd4eb00a4e79839.tar.gz tigervnc-4065997c5e952ef25e34b021bdd4eb00a4e79839.zip |
Do a generic check for inet_aton instead of just assuming that only Win32 has
the problem.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3982 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | common/network/TcpSocket.cxx | 4 | ||||
-rw-r--r-- | configure.ac | 1 |
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]) |