diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-07 16:44:57 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-07 16:44:57 +0000 |
commit | 94801190c47e8f2a70ac511fa6e586a92a1a5081 (patch) | |
tree | e65c44deb1fb71bdd439f2f0931abe2fc11f8749 /main | |
parent | 77bdc5a4fc7684b01a347f3729bbff3e5053570a (diff) |
These changes fix 10145 and 10150, a prob with BSD and exp2/log2 not existing, as well as the bootstrap needing a small upgrade for openbsd. Many thanks to mvanbaak
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@73821 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/ast_expr2.c | 12 | ||||
-rw-r--r-- | main/ast_expr2.y | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/main/ast_expr2.c b/main/ast_expr2.c index 7a55bc16f..2e25e0766 100644 --- a/main/ast_expr2.c +++ b/main/ast_expr2.c @@ -160,9 +160,13 @@ #define FUNC_RINT rintl #define FUNC_TRUNC truncl #define FUNC_EXP expl +#ifdef HAVE_EXP2 #define FUNC_EXP2 exp2l +#endif #define FUNC_LOG logl +#ifdef HAVE_LOG2 #define FUNC_LOG2 log2l +#endif #define FUNC_LOG10 log10l #define FUNC_REMAINDER remainderl #else @@ -185,9 +189,13 @@ #define FUNC_RINT rint #define FUNC_TRUNC trunc #define FUNC_EXP exp +#ifdef HAVE_EXP2 #define FUNC_EXP2 exp2 +#endif #define FUNC_LOG log +#ifdef HAVE_LOG2 #define FUNC_LOG2 log2 +#endif #define FUNC_LOG10 log10 #define FUNC_REMAINDER remainder #endif @@ -2631,6 +2639,7 @@ static struct val *op_func(struct val *funcname, struct expr_node *arglist, stru ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s); return make_number(0.0); } +#ifdef HAVE_EXP2 } else if (strcmp(funcname->u.s,"EXP2") == 0) { if (arglist && !arglist->right && arglist->val){ to_number(arglist->val); @@ -2640,6 +2649,7 @@ static struct val *op_func(struct val *funcname, struct expr_node *arglist, stru ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s); return make_number(0.0); } +#endif } else if (strcmp(funcname->u.s,"LOG") == 0) { if (arglist && !arglist->right && arglist->val){ to_number(arglist->val); @@ -2649,6 +2659,7 @@ static struct val *op_func(struct val *funcname, struct expr_node *arglist, stru ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s); return make_number(0.0); } +#ifdef HAVE_LOG2 } else if (strcmp(funcname->u.s,"LOG2") == 0) { if (arglist && !arglist->right && arglist->val){ to_number(arglist->val); @@ -2658,6 +2669,7 @@ static struct val *op_func(struct val *funcname, struct expr_node *arglist, stru ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s); return make_number(0.0); } +#endif } else if (strcmp(funcname->u.s,"LOG10") == 0) { if (arglist && !arglist->right && arglist->val){ to_number(arglist->val); diff --git a/main/ast_expr2.y b/main/ast_expr2.y index 89baf91bd..126a02856 100644 --- a/main/ast_expr2.y +++ b/main/ast_expr2.y @@ -41,9 +41,13 @@ #define FUNC_RINT rintl #define FUNC_TRUNC truncl #define FUNC_EXP expl +#ifdef HAVE_EXP2 #define FUNC_EXP2 exp2l +#endif #define FUNC_LOG logl +#ifdef HAVE_LOG2 #define FUNC_LOG2 log2l +#endif #define FUNC_LOG10 log10l #define FUNC_REMAINDER remainderl #else @@ -66,9 +70,13 @@ #define FUNC_RINT rint #define FUNC_TRUNC trunc #define FUNC_EXP exp +#ifdef HAVE_EXP2 #define FUNC_EXP2 exp2 +#endif #define FUNC_LOG log +#ifdef HAVE_LOG2 #define FUNC_LOG2 log2 +#endif #define FUNC_LOG10 log10 #define FUNC_REMAINDER remainder #endif @@ -803,6 +811,7 @@ static struct val *op_func(struct val *funcname, struct expr_node *arglist, stru ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s); return make_number(0.0); } +#ifdef HAVE_EXP2 } else if (strcmp(funcname->u.s,"EXP2") == 0) { if (arglist && !arglist->right && arglist->val){ to_number(arglist->val); @@ -812,6 +821,7 @@ static struct val *op_func(struct val *funcname, struct expr_node *arglist, stru ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s); return make_number(0.0); } +#endif } else if (strcmp(funcname->u.s,"LOG") == 0) { if (arglist && !arglist->right && arglist->val){ to_number(arglist->val); @@ -821,6 +831,7 @@ static struct val *op_func(struct val *funcname, struct expr_node *arglist, stru ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s); return make_number(0.0); } +#ifdef HAVE_LOG2 } else if (strcmp(funcname->u.s,"LOG2") == 0) { if (arglist && !arglist->right && arglist->val){ to_number(arglist->val); @@ -830,6 +841,7 @@ static struct val *op_func(struct val *funcname, struct expr_node *arglist, stru ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s); return make_number(0.0); } +#endif } else if (strcmp(funcname->u.s,"LOG10") == 0) { if (arglist && !arglist->right && arglist->val){ to_number(arglist->val); |