diff --git a/src/unix/gsocket.cpp b/src/unix/gsocket.cpp index eb7b1b5678..227bff1764 100644 --- a/src/unix/gsocket.cpp +++ b/src/unix/gsocket.cpp @@ -1656,7 +1656,7 @@ GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname) if (inet_aton(hostname, addr) == 0) { #elif defined(HAVE_INET_ADDR) - if ( (addr->s_addr = inet_addr(hostname)) == -1 ) + if ( (addr->s_addr = inet_addr(hostname)) == (in_addr_t)-1 ) { #else /* Use gethostbyname by default */