diff libpurple/proxy.c @ 23201:313b87adb730

A patch from Peter O'Gorman at The Written Word, Inc. to fix various portability issues. These changes seemed reasonable, even though I wasn't able to test or verify them all in particular. Hopefully we don't break anything on another OS. Refs #3798 committer: Richard Laager <rlaager@wiktel.com>
author Peter O'Gorman <pogma@thewrittenword.com>
date Tue, 27 May 2008 01:11:46 +0000
parents 2b91ea8c94d5
children 242fd82b5fe6
line wrap: on
line diff
--- a/libpurple/proxy.c	Mon May 26 17:10:55 2008 +0000
+++ b/libpurple/proxy.c	Tue May 27 01:11:46 2008 +0000
@@ -1726,6 +1726,10 @@
  * resolved, and each time a connection attempt fails (assuming there
  * is another IP address to try).
  */
+#ifndef INET6_ADDRSTRLEN
+#define INET6_ADDRSTRLEN 46
+#endif
+
 static void try_connect(PurpleProxyConnectData *connect_data)
 {
 	size_t addrlen;
@@ -1736,9 +1740,13 @@
 	connect_data->hosts = g_slist_remove(connect_data->hosts, connect_data->hosts->data);
 	addr = connect_data->hosts->data;
 	connect_data->hosts = g_slist_remove(connect_data->hosts, connect_data->hosts->data);
-
+#ifdef HAVE_INET_NTOP
 	inet_ntop(addr->sa_family, &((struct sockaddr_in *)addr)->sin_addr,
 			ipaddr, sizeof(ipaddr));
+#else
+	memcpy(ipaddr,inet_ntoa(((struct sockaddr_in *)addr)->sin_addr),
+			sizeof(ipaddr));
+#endif
 	purple_debug_info("proxy", "Attempting connection to %s\n", ipaddr);
 
 	switch (purple_proxy_info_get_type(connect_data->gpi)) {