[Freeswitch-trunk] [commit] r13829 - in freeswitch/trunk/src: . include
FreeSWITCH SVN
mrene at freeswitch.org
Wed Jun 17 23:01:46 PDT 2009
Author: mrene
Date: Thu Jun 18 01:01:45 2009
New Revision: 13829
Log:
Fix up SWITCH_CONFIG_ITEM_STRING_STRDUP to please windows
Modified:
freeswitch/trunk/src/include/switch_xml_config.h
freeswitch/trunk/src/switch_xml_config.c
Modified: freeswitch/trunk/src/include/switch_xml_config.h
==============================================================================
--- freeswitch/trunk/src/include/switch_xml_config.h (original)
+++ freeswitch/trunk/src/include/switch_xml_config.h Thu Jun 18 01:01:45 2009
@@ -99,7 +99,7 @@
};
#define SWITCH_CONFIG_ITEM(_key, _type, _flags, _ptr, _defaultvalue, _data, _syntax, _helptext) { _key, _type, _flags, _ptr, (void*)_defaultvalue, (void*)_data, NULL, _syntax, _helptext }
-#define SWITCH_CONFIG_ITEM_STRING_STRDUP(_key, _flags, _ptr, _defaultvalue, _syntax, _helptext) { (_key), SWITCH_CONFIG_STRING, (_flags), (_ptr), ((void*)_defaultvalue), (&switch_config_string_strdup), (NULL), (_syntax), (_helptext) }
+#define SWITCH_CONFIG_ITEM_STRING_STRDUP(_key, _flags, _ptr, _defaultvalue, _syntax, _helptext) { (_key), SWITCH_CONFIG_STRING, (_flags), (_ptr), ((void*)_defaultvalue), (NULL), (NULL), (_syntax), (_helptext) }
#define SWITCH_CONFIG_ITEM_CALLBACK(_key, _type, _flags, _ptr, _defaultvalue, _function, _functiondata, _syntax, _helptext) { _key, _type, _flags, _ptr, (void*)_defaultvalue, _functiondata, _function, _syntax, _helptext }
#define SWITCH_CONFIG_ITEM_END() { NULL, SWITCH_CONFIG_LAST, 0, NULL, NULL, NULL, NULL, NULL, NULL }
Modified: freeswitch/trunk/src/switch_xml_config.c
==============================================================================
--- freeswitch/trunk/src/switch_xml_config.c (original)
+++ freeswitch/trunk/src/switch_xml_config.c Thu Jun 18 01:01:45 2009
@@ -201,15 +201,10 @@
break;
case SWITCH_CONFIG_STRING:
{
- switch_xml_config_string_options_t *string_options = (switch_xml_config_string_options_t*)item->data;
+ switch_xml_config_string_options_t string_options_default = { 0 };
+ switch_xml_config_string_options_t *string_options = item->data ? (switch_xml_config_string_options_t*)item->data : &string_options_default;
const char *newstring = NULL;
- if (!string_options) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Missing mandatory switch_xml_config_string_options_t structure for parameter [%s], skipping!\n",
- item->key);
- return SWITCH_STATUS_FALSE;
- }
-
/* Perform validation */
if (value) {
if (!switch_strlen_zero(string_options->validation_regex)) {
More information about the Freeswitch-trunk
mailing list