[Freeswitch-svn] [commit] r10906 - in freeswitch/trunk/libs/esl/src: . include

FreeSWITCH SVN mikej at freeswitch.org
Sun Dec 21 21:37:55 PST 2008


Author: mikej
Date: Mon Dec 22 00:37:54 2008
New Revision: 10906

Log:
windows port

Modified:
   freeswitch/trunk/libs/esl/src/esl.c
   freeswitch/trunk/libs/esl/src/esl_event.c
   freeswitch/trunk/libs/esl/src/include/esl.h

Modified: freeswitch/trunk/libs/esl/src/esl.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl.c	Mon Dec 22 00:37:54 2008
@@ -429,8 +429,12 @@
 
 	for (;;) {
 		int client_sock;                    
-		struct sockaddr_in echoClntAddr; 
-		unsigned int clntLen;            
+		struct sockaddr_in echoClntAddr;
+#ifdef WIN32
+		int clntLen;
+#else
+		unsigned int clntLen;
+#endif
 
 		clntLen = sizeof(echoClntAddr);
     
@@ -572,9 +576,18 @@
 	esl_mutex_lock(handle->mutex);
 	FD_ZERO(&rfds);
 	FD_ZERO(&efds);
+
+#ifdef WIN32
+#pragma warning( push )
+#pragma warning( disable : 4127 )
 	FD_SET(handle->sock, &rfds);
 	FD_SET(handle->sock, &efds);
-	
+#pragma warning( pop ) 
+#else
+	FD_SET(handle->sock, &rfds);
+	FD_SET(handle->sock, &efds);
+#endif
+
 	max = handle->sock + 1;
 	
 	if ((activity = select(max, &rfds, NULL, &efds, &tv)) < 0) {

Modified: freeswitch/trunk/libs/esl/src/esl_event.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl_event.c	(original)
+++ freeswitch/trunk/libs/esl/src/esl_event.c	Mon Dec 22 00:37:54 2008
@@ -255,7 +255,7 @@
 		esl_assert(x < 1000);
 		hash = esl_ci_hashfunc_default(header_name, &hlen);
 
-		if ((!hp->hash || hash == hp->hash) && !strcasecmp(header_name, hp->name)) {
+		if (hp->name && (!hp->hash || hash == hp->hash) && !strcasecmp(header_name, hp->name)) {
 			if (lp) {
 				lp->next = hp->next;
 			} else {

Modified: freeswitch/trunk/libs/esl/src/include/esl.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl.h	(original)
+++ freeswitch/trunk/libs/esl/src/include/esl.h	Mon Dec 22 00:37:54 2008
@@ -167,8 +167,15 @@
 #include <strings.h>
 #endif
 #include <assert.h>
+
+#if (_MSC_VER >= 1400)			// VC8+
+#define esl_assert(expr) assert(expr);__analysis_assume( expr )
+#endif
 
+#ifndef esl_assert
 #define esl_assert(_x) assert(_x)
+#endif
+
 #define esl_safe_free(_x) if (_x) free(_x); _x = NULL
 #define esl_strlen_zero(s) (!s || *(s) == '\0')
 #define esl_strlen_zero_buf(s) (*(s) == '\0')
@@ -188,6 +195,7 @@
 typedef intptr_t esl_ssize_t;
 typedef int esl_filehandle_t;
 #define ESL_SOCK_INVALID INVALID_SOCKET
+#define strerror_r(num, buf, size) strerror_s(buf, size, num)
 #else
 #include <stdint.h>
 #include <sys/types.h>



More information about the Freeswitch-svn mailing list