]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix mod_yaml build on newer gcc
authorMichael Jerris <mike@jerris.com>
Thu, 28 Aug 2008 16:41:48 +0000 (16:41 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 28 Aug 2008 16:41:48 +0000 (16:41 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9381 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_utils.h
src/mod/languages/mod_yaml/mod_yaml.c

index e2b6cdda0420dbe73666c7c783f924467acdc42d..16efdebb5bad02b88d6b840c6b5870001be01bea 100644 (file)
@@ -106,6 +106,15 @@ SWITCH_DECLARE(switch_size_t) switch_fd_read_line(int fd, char *buf, switch_size
 !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
index a8b3d4a8a082bc35e7c8ff86cba3ef0afbc20caa..aa6137cd3f1663728dc6eb101ebdb2d778dea8f2 100644 (file)
@@ -476,7 +476,7 @@ static switch_status_t do_config(void)
                                        } 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);
                                                        }