[Freeswitch-svn] [commit] r9381 - in freeswitch/trunk/src: include mod/languages/mod_yaml

Freeswitch SVN mikej at freeswitch.org
Thu Aug 28 12:41:49 EDT 2008


Author: mikej
Date: Thu Aug 28 12:41:48 2008
New Revision: 9381

Modified:
   freeswitch/trunk/src/include/switch_utils.h
   freeswitch/trunk/src/mod/languages/mod_yaml/mod_yaml.c

Log:
fix mod_yaml build on newer gcc

Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h	(original)
+++ freeswitch/trunk/src/include/switch_utils.h	Thu Aug 28 12:41:48 2008
@@ -106,6 +106,15 @@
 !strcasecmp(expr, "allow") ||\
 atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE
 
+#define switch_true_buf(expr)\
+(( !strcasecmp(expr, "yes") ||\
+!strcasecmp(expr, "on") ||\
+!strcasecmp(expr, "true") ||\
+!strcasecmp(expr, "enabled") ||\
+!strcasecmp(expr, "active") ||\
+!strcasecmp(expr, "allow") ||\
+atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE
+
 /*!
   \brief Evaluate the falsefullness of a string expression
   \param expr a string expression

Modified: freeswitch/trunk/src/mod/languages/mod_yaml/mod_yaml.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_yaml/mod_yaml.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_yaml/mod_yaml.c	Thu Aug 28 12:41:48 2008
@@ -476,7 +476,7 @@
 					} else {
 						switch_set_string(value, scalar_data);
 						if (!strcasecmp(category, "settings")) {
-							if (!strcasecmp(name, "bind_config") && switch_true(value)) {
+							if (!strcasecmp(name, "bind_config") && switch_true_buf(value)) {
 								switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Binding To XML Config\n");
 								switch_xml_bind_search_function(yaml_fetch, switch_xml_parse_section_string("config"), NULL);
 							}



More information about the Freeswitch-svn mailing list