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

FreeSWITCH SVN mikej at freeswitch.org
Mon Dec 22 10:53:09 PST 2008


Author: mikej
Date: Mon Dec 22 13:53:09 2008
New Revision: 10911

Log:
fs_cli now builds on windows, does not yet work

Added:
   freeswitch/trunk/libs/esl/fs_cli.2008.vcproj
   freeswitch/trunk/libs/esl/src/esl.2008.vcproj
Removed:
   freeswitch/trunk/libs/esl/esl.2008.vcproj
Modified:
   freeswitch/trunk/Freeswitch.2008.sln
   freeswitch/trunk/libs/esl/fs_cli.c
   freeswitch/trunk/libs/esl/src/   (props changed)
   freeswitch/trunk/libs/esl/src/esl.c
   freeswitch/trunk/libs/esl/src/include/esl.h

Modified: freeswitch/trunk/Freeswitch.2008.sln
==============================================================================
--- freeswitch/trunk/Freeswitch.2008.sln	(original)
+++ freeswitch/trunk/Freeswitch.2008.sln	Mon Dec 22 13:53:09 2008
@@ -998,7 +998,12 @@
 		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C} = {1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esl", "libs\esl\esl.2008.vcproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esl", "libs\esl\src\esl.2008.vcproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fs_cli", "libs\esl\fs_cli.2008.vcproj", "{D2FB8043-D208-4AEE-8F18-3B5857C871B9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E} = {CF405366-9558-4AE8-90EF-5E21B51CCB4E}
+	EndProjectSection
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1762,6 +1767,10 @@
 		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.ActiveCfg = Release|Win32
 		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.Build.0 = Release|Win32
 		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.ActiveCfg = Release|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|x64.ActiveCfg = Debug|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.ActiveCfg = Release|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|x64.ActiveCfg = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Added: freeswitch/trunk/libs/esl/fs_cli.2008.vcproj
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/fs_cli.2008.vcproj	Mon Dec 22 13:53:09 2008
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="fs_cli"
+	ProjectGUID="{D2FB8043-D208-4AEE-8F18-3B5857C871B9}"
+	RootNamespace="fs_cli"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="..\..\w32\winlibs.vsprops"
+			CharacterSet="2"
+			BuildLogFile="$(IntDir)\BuildLog $(ProjectName).htm"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(InputDir)\src\include&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				WarnAsError="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100;6053;4706"
+				EnablePREfast="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(SolutionDir)$(ConfigurationName)/fs_cli.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/fs_cli.pdb"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="..\..\w32\winlibs.vsprops"
+			CharacterSet="2"
+			BuildLogFile="$(IntDir)\BuildLog $(ProjectName).htm"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;$(InputDir)\src\include&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				WarnAsError="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4100;6053;4706"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(SolutionDir)$(ConfigurationName)/fs_cli.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="$(OutDir)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/fs_cli.pdb"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="fs_cli.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\..\src\include\switch.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_buffer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_caller.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_channel.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_config.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_console.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_core.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_frame.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_loadable_module.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_module_interfaces.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_types.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\include\switch_utils.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Modified: freeswitch/trunk/libs/esl/fs_cli.c
==============================================================================
--- freeswitch/trunk/libs/esl/fs_cli.c	(original)
+++ freeswitch/trunk/libs/esl/fs_cli.c	Mon Dec 22 13:53:09 2008
@@ -2,13 +2,20 @@
 #include <stdlib.h>
 #include <esl.h>
 #include <signal.h>
-#include <sys/select.h>
 
+#ifdef WIN32
+#define strdup(src) _strdup(src)
+#define usleep(time) Sleep(time/1000)
+#else
+#include <sys/select.h>
 #include <histedit.h>
+#define HAVE_EDITLINE
+#endif
 
 static char prompt_str[512] = "";
 static char hostname[512] = "";
 
+#ifdef HAVE_EDITLINE
 static char *prompt(EditLine * e)
 {
     return prompt_str;
@@ -17,6 +24,8 @@
 static EditLine *el;
 static History *myhistory;
 static HistEvent ev;
+#endif
+
 static int running = 1;
 static int thread_running = 0;
 
@@ -149,8 +158,8 @@
 int main(int argc, char *argv[])
 {
 	esl_handle_t handle = {{0}};
-	int count;
-	const char *line;
+	int count = 0;
+	const char *line = NULL;
 	char cmd_str[1024] = "";
 	char hfile[512] = "/tmp/fs_cli_history";
 	char cfile[512] = "/tmp/fs_cli_config";
@@ -199,7 +208,7 @@
 			} else if (!strcasecmp(var, "port")) {
 				int pt = atoi(val);
 				if (pt > 0) {
-					profiles[cur].port = pt;
+					profiles[cur].port = (esl_port_t)pt;
 				}
 			}
 		}
@@ -227,7 +236,8 @@
 	}
 	
 	esl_thread_create_detached(msg_thread_run, &handle);
-	
+
+#ifdef HAVE_EDITLINE
 	el = el_init(__FILE__, stdout, stdout, stdout);
 	el_set(el, EL_PROMPT, &prompt);
 	el_set(el, EL_EDITOR, "emacs");
@@ -241,7 +251,8 @@
 	history(myhistory, &ev, H_SETSIZE, 800);
 	el_set(el, EL_HIST, history, myhistory);
 	history(myhistory, &ev, H_LOAD, hfile);
-	
+#endif
+
 	snprintf(cmd_str, sizeof(cmd_str), "log info\n\n");
 	esl_send_recv(&handle, cmd_str);
 
@@ -249,19 +260,28 @@
 
 	while (running) {
 
+#ifdef HAVE_EDITLINE
 		line = el_gets(el, &count);
-		
+#endif
+
 		if (count > 1) {
 			if (!esl_strlen_zero(line)) {
 				char *cmd = strdup(line);
 				char *p;
+
+#ifdef HAVE_EDITLINE
 				const LineInfo *lf = el_line(el);
 				char *foo = (char *) lf->buffer;
+#endif
+
 				if ((p = strrchr(cmd, '\r')) || (p = strrchr(cmd, '\n'))) {
 					*p = '\0';
 				}
 				assert(cmd != NULL);
+
+#ifdef HAVE_EDITLINE
 				history(myhistory, &ev, H_ENTER, line);
+#endif
 
 				if (!strncasecmp(cmd, "...", 3)) {
 					goto done;
@@ -277,8 +297,10 @@
 					}
 				}
 
+#ifdef HAVE_EDITLINE
 				el_deletestr(el, strlen(foo) + 1);
 				memset(foo, 0, strlen(foo));
+#endif
 				free(cmd);
 			}
 		}
@@ -290,11 +312,13 @@
 
  done:
 	
+#ifdef HAVE_EDITLINE
 	history(myhistory, &ev, H_SAVE, hfile);
 
 	/* Clean up our memory */
 	history_end(myhistory);
 	el_end(el);
+#endif
 
 	esl_disconnect(&handle);
 	

Added: freeswitch/trunk/libs/esl/src/esl.2008.vcproj
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/src/esl.2008.vcproj	Mon Dec 22 13:53:09 2008
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="esl"
+	ProjectGUID="{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
+	RootNamespace="esl"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)Debug"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_EXPORTS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				WarnAsError="true"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4706;4100"
+				EnablePREfast="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Ws2_32.lib"
+				ModuleDefinitionFile=""
+				OptimizeReferences="1"
+				EnableCOMDATFolding="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary="$(IntDir)/$(TargetName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)Release"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_EXPORTS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				WarnAsError="true"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4706;4100"
+				EnablePREfast="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Ws2_32.lib"
+				ModuleDefinitionFile=""
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary="$(IntDir)/$(TargetName).lib"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\esl.c"
+				>
+			</File>
+			<File
+				RelativePath=".\esl_config.c"
+				>
+			</File>
+			<File
+				RelativePath=".\esl_event.c"
+				>
+			</File>
+			<File
+				RelativePath=".\esl_threadmutex.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\include\esl.h"
+				>
+			</File>
+			<File
+				RelativePath=".\include\esl_config.h"
+				>
+			</File>
+			<File
+				RelativePath=".\include\esl_event.h"
+				>
+			</File>
+			<File
+				RelativePath=".\include\esl_threadmutex.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

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 13:53:09 2008
@@ -175,23 +175,23 @@
 	return NULL;
 }
 
-#ifdef WIN32
-#ifndef vsnprintf
-#define vsnprintf _vsnprintf
-#endif
-#endif
-
-ESL_DECLARE(int) esl_snprintf(char *buffer, size_t count, const char *fmt, ...)
-{
-	va_list ap;
-	int ret;
-
-	va_start(ap, fmt);
-	ret = vsnprintf(buffer, count-1, fmt, ap);
-	if (ret < 0)
-		buffer[count-1] = '\0';
-	va_end(ap);
-	return ret;
+#ifdef WIN32
+#ifndef vsnprintf
+#define vsnprintf _vsnprintf
+#endif
+#endif
+
+ESL_DECLARE(int) esl_snprintf(char *buffer, size_t count, const char *fmt, ...)
+{
+	va_list ap;
+	int ret;
+
+	va_start(ap, fmt);
+	ret = vsnprintf(buffer, count-1, fmt, ap);
+	if (ret < 0)
+		buffer[count-1] = '\0';
+	va_end(ap);
+	return ret;
 }
 
 static void null_logger(const char *file, const char *func, int line, int level, const char *fmt, ...)
@@ -261,7 +261,7 @@
 
 esl_logger_t esl_log = null_logger;
 
-void esl_global_set_logger(esl_logger_t logger)
+ESL_DECLARE(void) esl_global_set_logger(esl_logger_t logger)
 {
 	if (logger) {
 		esl_log = logger;
@@ -270,7 +270,7 @@
 	}
 }
 
-void esl_global_set_default_logger(int level)
+ESL_DECLARE(void) esl_global_set_default_logger(int level)
 {
 	if (level < 0 || level > 7) {
 		level = 7;
@@ -410,7 +410,7 @@
 static int esl_socket_reuseaddr(esl_socket_t socket) 
 {
 #ifdef WIN32
-	BOOL reuse_addr = TRUE;
+	BOOL reuse_addr = TRUE;
 	return setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse_addr, sizeof(reuse_addr));
 #else
 	int reuse_addr = 1;
@@ -596,11 +596,11 @@
 	FD_ZERO(&efds);
 
 #ifdef WIN32
-#pragma warning( push )
+#pragma warning( push )
 #pragma warning( disable : 4127 )
 	FD_SET(handle->sock, &rfds);
 	FD_SET(handle->sock, &efds);
-#pragma warning( pop ) 
+#pragma warning( pop ) 
 #else
 	FD_SET(handle->sock, &rfds);
 	FD_SET(handle->sock, &efds);

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 13:53:09 2008
@@ -163,10 +163,10 @@
 #include <strings.h>
 #endif
 #include <assert.h>
-
-#if (_MSC_VER >= 1400)			// VC8+
-#define esl_assert(expr) assert(expr);__analysis_assume( expr )
-#endif
+
+#if (_MSC_VER >= 1400)			// VC8+
+#define esl_assert(expr) assert(expr);__analysis_assume( expr )
+#endif
 
 #ifndef esl_assert
 #define esl_assert(_x) assert(_x)
@@ -192,23 +192,23 @@
 typedef int esl_filehandle_t;
 #define ESL_SOCK_INVALID INVALID_SOCKET
 #define strerror_r(num, buf, size) strerror_s(buf, size, num)
-#if defined(ESL_DECLARE_STATIC)
-#define ESL_DECLARE(type)			type __stdcall
-#define ESL_DECLARE_NONSTD(type)		type __cdecl
-#define ESL_DECLARE_DATA
-#elif defined(ESL_EXPORTS)
-#define ESL_DECLARE(type)			__declspec(dllexport) type __stdcall
-#define ESL_DECLARE_NONSTD(type)		__declspec(dllexport) type __cdecl
-#define ESL_DECLARE_DATA				__declspec(dllexport)
-#else
-#define ESL_DECLARE(type)			__declspec(dllimport) type __stdcall
-#define ESL_DECLARE_NONSTD(type)		__declspec(dllimport) type __cdecl
-#define ESL_DECLARE_DATA				__declspec(dllimport)
-#endif
+#if defined(ESL_DECLARE_STATIC)
+#define ESL_DECLARE(type)			type __stdcall
+#define ESL_DECLARE_NONSTD(type)		type __cdecl
+#define ESL_DECLARE_DATA
+#elif defined(ESL_EXPORTS)
+#define ESL_DECLARE(type)			__declspec(dllexport) type __stdcall
+#define ESL_DECLARE_NONSTD(type)		__declspec(dllexport) type __cdecl
+#define ESL_DECLARE_DATA				__declspec(dllexport)
+#else
+#define ESL_DECLARE(type)			__declspec(dllimport) type __stdcall
+#define ESL_DECLARE_NONSTD(type)		__declspec(dllimport) type __cdecl
+#define ESL_DECLARE_DATA				__declspec(dllimport)
+#endif
 #else
-#define ESL_DECLARE(type) type
-#define ESL_DECLARE_NONSTD(type) type
-#define ESL_DECLARE_DATA
+#define ESL_DECLARE(type) type
+#define ESL_DECLARE_NONSTD(type) type
+#define ESL_DECLARE_DATA
 #include <stdint.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
@@ -281,10 +281,10 @@
 #define ESL_LOG_EMERG ESL_PRE, ESL_LOG_LEVEL_EMERG
 typedef void (*esl_logger_t)(const char *file, const char *func, int line, int level, const char *fmt, ...);
 
-extern esl_logger_t esl_log;
+ESL_DECLARE_DATA extern esl_logger_t esl_log;
 
-void esl_global_set_logger(esl_logger_t logger);
-void esl_global_set_default_logger(int level);
+ESL_DECLARE(void) esl_global_set_logger(esl_logger_t logger);
+ESL_DECLARE(void) esl_global_set_default_logger(int level);
 
 #include "esl_event.h"
 #include "esl_threadmutex.h"
@@ -295,7 +295,7 @@
 ESL_DECLARE(const char *)esl_stristr(const char *instr, const char *str);
 ESL_DECLARE(int) esl_toupper(int c);
 ESL_DECLARE(int) esl_tolower(int c);
-ESL_DECLARE(int) esl_snprintf(char *buffer, size_t count, const char *fmt, ...);
+ESL_DECLARE(int) esl_snprintf(char *buffer, size_t count, const char *fmt, ...);
 
 
 typedef void (*esl_listen_callback_t)(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in addr);



More information about the Freeswitch-svn mailing list