Revision
17495
Author
jeff
Date
2010-05-05 15:15:01 -0500 (Wed, 05 May 2010)

Log Message

fix for Windows XP inet_ntop execution - you must compile with XP for support.

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_utils.c (17494 => 17495)


--- freeswitch/trunk/src/switch_utils.c	2010-05-05 20:15:00 UTC (rev 17494)
+++ freeswitch/trunk/src/switch_utils.c	2010-05-05 20:15:01 UTC (rev 17495)
@@ -1331,7 +1331,7 @@
 	return strcpy(dst, tmp);
 }
 
-#if HAVE_SIN6
+#if HAVE_SIN6 || (defined(NTDDI_VERSION) && (NTDDI_VERSION < NTDDI_VISTA))
 /* const char *
  * inet_ntop6(src, dst, size)
  *	convert IPv6 binary address into presentation (printable) format
@@ -1402,7 +1402,7 @@
 			*tp++ = ':';
 		/* Is this address an encapsulated IPv4? */
 		if (i == 6 && best.base == 0 && (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
-			if (!inet_ntop4(src + 12, tp, sizeof tmp - (tp - tmp)))
+			if (!switch_inet_ntop4(src + 12, tp, sizeof tmp - (tp - tmp)))
 				return (NULL);
 			tp += strlen(tp);
 			break;
@@ -1488,7 +1488,11 @@
 	*buf = '\0';
 
 	if (sa) {
+#if defined(NTDDI_VERSION) && (NTDDI_VERSION < NTDDI_VISTA)
+			switch_inet_ntop6((unsigned char*)sa, buf, len);
+#else
 		inet_ntop(AF_INET6, sa, buf, len);
+#endif
 	}
 
 	return buf;