[Freeswitch-trunk] [commit] r6628 - in freeswitch/trunk/src: . include

Freeswitch SVN mikej at freeswitch.org
Tue Dec 11 05:01:56 EST 2007


Author: mikej
Date: Tue Dec 11 05:01:55 2007
New Revision: 6628

Modified:
   freeswitch/trunk/src/include/switch.h
   freeswitch/trunk/src/switch_utils.c

Log:
fix for msvc 9 build.

Modified: freeswitch/trunk/src/include/switch.h
==============================================================================
--- freeswitch/trunk/src/include/switch.h	(original)
+++ freeswitch/trunk/src/include/switch.h	Tue Dec 11 05:01:55 2007
@@ -71,7 +71,10 @@
 #include <setjmp.h>
 #include <ctype.h>
 #include <fcntl.h>
-#ifndef _MSC_VER
+#ifdef _MSC_VER
+#include <Winsock2.h>
+#include <Ws2tcpip.h>
+#else
 #include <strings.h>
 #endif
 #include <string.h>

Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c	(original)
+++ freeswitch/trunk/src/switch_utils.c	Tue Dec 11 05:01:55 2007
@@ -742,7 +742,9 @@
 
 static char RFC2833_CHARS[] = "0123456789*#ABCDF";
 
-#ifdef _MSC_VER
+#ifndef _MSC_VER
+#define switch_inet_ntop inet_ntop
+#else
 /* Copyright (c) 1996 by Internet Software Consortium.
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -772,9 +774,9 @@
  * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
  */
 
-static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size);
+static const char *switch_inet_ntop4(const unsigned char *src, char *dst, size_t size);
 #if HAVE_SIN6
-static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size);
+static const char *switch_inet_ntop6(const unsigned char *src, char *dst, size_t size);
 #endif
 
 /* char *
@@ -786,15 +788,15 @@
  *	Paul Vixie, 1996.
  */
 const char *
-inet_ntop(int af, void const *src, char *dst, size_t size)
+switch_inet_ntop(int af, void const *src, char *dst, size_t size)
 {
 
 	switch (af) {
 	case AF_INET:
-		return inet_ntop4(src, dst, size);
+		return switch_inet_ntop4(src, dst, size);
 #if HAVE_SIN6
 	case AF_INET6:
-		return inet_ntop6(src, dst, size);
+		return switch_inet_ntop6(src, dst, size);
 #endif
 	default:
 		return NULL;
@@ -814,7 +816,7 @@
  *	Paul Vixie, 1996.
  */
 static const char *
-inet_ntop4(const unsigned char *src, char *dst, size_t size)
+switch_inet_ntop4(const unsigned char *src, char *dst, size_t size)
 {
 	static const char fmt[] = "%u.%u.%u.%u";
 	char tmp[sizeof "255.255.255.255"];
@@ -835,7 +837,7 @@
  *	Paul Vixie, 1996.
  */
 static const char *
-inet_ntop6(unsigned char const *src, char *dst, size_t size)
+switch_inet_ntop6(unsigned char const *src, char *dst, size_t size)
 {
 	/*
 	 * Note that int32_t and int16_t need only be "at least" large enough
@@ -927,7 +929,7 @@
 	assert(buf);
 	*buf = '\0';
 	if (in) {
-		inet_ntop(AF_INET, in, buf, len);
+		switch_inet_ntop(AF_INET, in, buf, len);
 	}
 	return buf;
 }



More information about the Freeswitch-trunk mailing list