From cf2bcc233aa578c5b66472ded88ff635f56726cf Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 11 Apr 2006 21:41:00 +0000 Subject: [PATCH] add logger and mod_console to win32 build, fix warnings. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1119 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../loggers/mod_console/mod_console.vcproj | 209 ++++++++++++++++++ src/switch_log.c | 9 +- w32/vsnet/FreeSwitchCore.vcproj | 8 + w32/vsnet/Freeswitch.sln | 12 + 4 files changed, 234 insertions(+), 4 deletions(-) create mode 100644 src/mod/loggers/mod_console/mod_console.vcproj diff --git a/src/mod/loggers/mod_console/mod_console.vcproj b/src/mod/loggers/mod_console/mod_console.vcproj new file mode 100644 index 0000000000..eff6e1319c --- /dev/null +++ b/src/mod/loggers/mod_console/mod_console.vcproj @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/switch_log.c b/src/switch_log.c index b3c699359b..bef8d6d685 100644 --- a/src/switch_log.c +++ b/src/switch_log.c @@ -102,6 +102,7 @@ static void *SWITCH_THREAD_FUNC log_thread(switch_thread *thread, void *obj) for(;;) { void *pop = NULL; switch_log_node *node = NULL; + switch_log_binding *binding; if (switch_queue_pop(LOG_QUEUE, &pop) != SWITCH_STATUS_SUCCESS) { break; @@ -113,7 +114,6 @@ static void *SWITCH_THREAD_FUNC log_thread(switch_thread *thread, void *obj) node = (switch_log_node *) pop; - switch_log_binding *binding; switch_mutex_lock(BINDLOCK); for(binding = BINDINGS; binding; binding = binding->next) { if (binding->level >= node->level) { @@ -157,7 +157,7 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel channel, char *file, switch_time_exp_lt(&tm, switch_time_now()); switch_strftime(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm); - len = strlen(extra_fmt) + strlen(date) + strlen(filep) + 32 + strlen(func) + strlen(fmt); + len = (uint32_t)(strlen(extra_fmt) + strlen(date) + strlen(filep) + 32 + strlen(func) + strlen(fmt)); new_fmt = malloc(len+1); snprintf(new_fmt, len, extra_fmt, date, LEVELS[level], filep, line, func, fmt); fmt = new_fmt; @@ -208,12 +208,13 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel channel, char *file, SWITCH_DECLARE(switch_status) switch_log_init(switch_memory_pool *pool) { + switch_thread *thread; + switch_threadattr_t *thd_attr;; + assert(pool != NULL); LOG_POOL = pool; - switch_thread *thread; - switch_threadattr_t *thd_attr;; switch_threadattr_create(&thd_attr, LOG_POOL); switch_threadattr_detach_set(thd_attr, 1); diff --git a/w32/vsnet/FreeSwitchCore.vcproj b/w32/vsnet/FreeSwitchCore.vcproj index b50cf42b62..51869ad237 100644 --- a/w32/vsnet/FreeSwitchCore.vcproj +++ b/w32/vsnet/FreeSwitchCore.vcproj @@ -231,6 +231,10 @@ RelativePath="..\..\src\switch_loadable_module.c" > + + @@ -301,6 +305,10 @@ RelativePath="..\..\src\include\switch_loadable_module.h" > + + diff --git a/w32/vsnet/Freeswitch.sln b/w32/vsnet/Freeswitch.sln index 0d61d84710..ad7b0fe94d 100644 --- a/w32/vsnet/Freeswitch.sln +++ b/w32/vsnet/Freeswitch.sln @@ -192,6 +192,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_commands", "..\..\src\m {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_console", "..\..\src\mod\loggers\mod_console\mod_console.vcproj", "{1C453396-D912-4213-89FD-9B489162B7B5}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -328,6 +335,10 @@ Global {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.Build.0 = Debug|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.ActiveCfg = Release|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.Build.0 = Release|Win32 + {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.ActiveCfg = Debug|Win32 + {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.Build.0 = Debug|Win32 + {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.ActiveCfg = Release|Win32 + {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -364,5 +375,6 @@ Global {B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8} = {0C808854-54D1-4230-BFF5-77B5FD905000} {7B077E7F-1BE7-4291-AB86-55E527B25CAC} = {0C808854-54D1-4230-BFF5-77B5FD905000} {692F6330-4D87-4C82-81DF-40DB5892636E} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0} + {1C453396-D912-4213-89FD-9B489162B7B5} = {A7AB4405-FDB7-4853-9FBB-1516B1C3D80A} EndGlobalSection EndGlobal