Simplify some preprocessor logic by using #elif

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-10-17 21:16:40 +00:00
parent 6998be1b3b
commit 727a908023
3 changed files with 165 additions and 335 deletions

View File

@@ -145,200 +145,122 @@
#include <stdio.h> #include <stdio.h>
#include "asterisk.h" #include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define FP___PRINTF "%.18Lg" #define FP___PRINTF "%.18Lg"
#define FP___TYPE long double #define FP___TYPE long double
#ifdef HAVE_COSL #ifdef HAVE_COSL
#define FUNC_COS cosl #define FUNC_COS cosl
#else #elif defined(HAVE_COS)
#ifdef HAVE_COS
#define FUNC_COS (long double)cos #define FUNC_COS (long double)cos
#else
#undef FUNC_COS
#endif
#endif #endif
#ifdef HAVE_SINL #ifdef HAVE_SINL
#define FUNC_SIN sinl #define FUNC_SIN sinl
#else #elif defined(HAVE_SIN)
#ifdef HAVE_SIN
#define FUNC_SIN (long double)sin #define FUNC_SIN (long double)sin
#else
#undef FUNC_SIN
#endif
#endif #endif
#ifdef HAVE_TANL #ifdef HAVE_TANL
#define FUNC_TAN tanl #define FUNC_TAN tanl
#else #elif defined(HAVE_TAN)
#ifdef HAVE_TAN
#define FUNC_TAN (long double)tan #define FUNC_TAN (long double)tan
#else
#undef FUNC_TAN
#endif
#endif #endif
#ifdef HAVE_ACOSL #ifdef HAVE_ACOSL
#define FUNC_ACOS acosl #define FUNC_ACOS acosl
#else #elif defined(HAVE_ACOS)
#ifdef HAVE_ACOS
#define FUNC_ACOS (long double)acos #define FUNC_ACOS (long double)acos
#else
#undef FUNC_ACOS
#endif
#endif #endif
#ifdef HAVE_ASINL #ifdef HAVE_ASINL
#define FUNC_ASIN asinl #define FUNC_ASIN asinl
#else #elif defined(HAVE_ASIN)
#ifdef HAVE_ASIN
#define FUNC_ASIN (long double)asin #define FUNC_ASIN (long double)asin
#else
#undef FUNC_ASIN
#endif
#endif #endif
#ifdef HAVE_ATANL #ifdef HAVE_ATANL
#define FUNC_ATAN atanl #define FUNC_ATAN atanl
#else #elif defined(HAVE_ATAN)
#ifdef HAVE_ATAN
#define FUNC_ATAN (long double)atan #define FUNC_ATAN (long double)atan
#else
#undef FUNC_ATAN
#endif
#endif #endif
#ifdef HAVE_ATAN2L #ifdef HAVE_ATAN2L
#define FUNC_ATAN2 atan2l #define FUNC_ATAN2 atan2l
#else #elif defined(HAVE_ATAN2)
#ifdef HAVE_ATAN2
#define FUNC_ATAN2 (long double)atan2 #define FUNC_ATAN2 (long double)atan2
#else
#undef FUNC_ATAN2
#endif
#endif #endif
#ifdef HAVE_POWL #ifdef HAVE_POWL
#define FUNC_POW powl #define FUNC_POW powl
#else #elif defined(HAVE_POW)
#ifdef HAVE_POW
#define FUNC_POW (long double)pow #define FUNC_POW (long double)pow
#else
#undef FUNC_POW
#endif
#endif #endif
#ifdef HAVE_SQRTL #ifdef HAVE_SQRTL
#define FUNC_SQRT sqrtl #define FUNC_SQRT sqrtl
#else #elif defined(HAVE_SQRT)
#ifdef HAVE_SQRT
#define FUNC_SQRT (long double)sqrt #define FUNC_SQRT (long double)sqrt
#else
#undef FUNC_SQRT
#endif
#endif #endif
#ifdef HAVE_RINTL #ifdef HAVE_RINTL
#define FUNC_RINT rintl #define FUNC_RINT rintl
#else #elif defined(HAVE_RINT)
#ifdef HAVE_RINT
#define FUNC_RINT (long double)rint #define FUNC_RINT (long double)rint
#else
#undef FUNC_RINT
#endif
#endif #endif
#ifdef HAVE_EXPL #ifdef HAVE_EXPL
#define FUNC_EXP expl #define FUNC_EXP expl
#else #elif defined(HAVE_EXP)
#ifdef HAVE_EXP
#define FUNC_EXP (long double)exp #define FUNC_EXP (long double)exp
#else
#undef FUNC_EXP
#endif
#endif #endif
#ifdef HAVE_LOGL #ifdef HAVE_LOGL
#define FUNC_LOG logl #define FUNC_LOG logl
#else #elif defined(HAVE_LOG)
#ifdef HAVE_LOG
#define FUNC_LOG (long double)log #define FUNC_LOG (long double)log
#else
#undef FUNC_LOG
#endif
#endif #endif
#ifdef HAVE_REMINDERL #ifdef HAVE_REMINDERL
#define FUNC_REMINDER reminderl #define FUNC_REMINDER reminderl
#else #elif defined(HAVE_REMINDER)
#ifdef HAVE_REMINDER
#define FUNC_REMINDER (long double)reminder #define FUNC_REMINDER (long double)reminder
#else
#undef FUNC_REMINDER
#endif
#endif #endif
#ifdef HAVE_FMODL #ifdef HAVE_FMODL
#define FUNC_FMOD fmodl #define FUNC_FMOD fmodl
#else #elif defined(HAVE_FMOD)
#ifdef HAVE_FMOD
#define FUNC_FMOD (long double)fmod #define FUNC_FMOD (long double)fmod
#else
#undef FUNC_FMOD
#endif
#endif #endif
#ifdef HAVE_STRTOLD #ifdef HAVE_STRTOLD
#define FUNC_STRTOD strtold #define FUNC_STRTOD strtold
#else #elif defined(HAVE_STRTOD)
#ifdef HAVE_STRTOD
#define FUNC_STRTOD (long double)strtod #define FUNC_STRTOD (long double)strtod
#else
#undef FUNC_STRTOD
#endif
#endif #endif
#ifdef HAVE_FLOORL #ifdef HAVE_FLOORL
#define FUNC_FLOOR floorl #define FUNC_FLOOR floorl
#else #elif defined(HAVE_FLOOR)
#ifdef HAVE_FLOOR
#define FUNC_FLOOR (long double)floor #define FUNC_FLOOR (long double)floor
#else #endif
#undef FUNC_FLOOR
#endif /* defined(HAVE_FLOOR) */
#endif /* defined(HAVE_FLOORL) */
#ifdef HAVE_CEILL #ifdef HAVE_CEILL
#define FUNC_CEIL ceill #define FUNC_CEIL ceill
#else #elif defined(HAVE_CEIL)
#ifdef HAVE_CEIL
#define FUNC_CEIL (long double)ceil #define FUNC_CEIL (long double)ceil
#else #endif
#undef FUNC_CEIL
#endif /* defined(HAVE_CEIL) */
#endif /* defined(HAVE_CEILL) */
#ifdef HAVE_ROUNDL #ifdef HAVE_ROUNDL
#define FUNC_ROUND roundl #define FUNC_ROUND roundl
#else /* HAVE_ROUNDL */ #elif defined(HAVE_ROUND)
#ifdef HAVE_ROUND
#define FUNC_ROUND (long double)round #define FUNC_ROUND (long double)round
#else /* HAVE_ROUND */ #endif
#undef FUNC_ROUND
#endif /* HAVE_ROUND */
#endif /* HAVE_ROUNDL */
#ifdef HAVE_TRUNCL #ifdef HAVE_TRUNCL
#define FUNC_TRUNC truncl #define FUNC_TRUNC truncl
#else /* HAVE_TRUNCL */ #elif defined(HAVE_TRUNC)
#ifdef HAVE_TRUNC
#define FUNC_TRUNC (long double)trunc #define FUNC_TRUNC (long double)trunc
#else /* HAVE_TRUNC */ #endif
#undef FUNC_TRUNC
#endif /* HAVE_TRUNC */
#endif /* HAVE_TRUNCL */
/*! \note /*! \note
* Oddly enough, some platforms have some ISO C99 functions, but not others, so * Oddly enough, some platforms have some ISO C99 functions, but not others, so
@@ -346,51 +268,43 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
*/ */
#ifdef HAVE_EXP2L #ifdef HAVE_EXP2L
#define FUNC_EXP2 exp2l #define FUNC_EXP2 exp2l
#else #elif (defined(HAVE_EXPL) && defined(HAVE_LOGL))
#if (defined(HAVE_EXPL) && defined(HAVE_LOGL))
#define FUNC_EXP2(x) expl((x) * logl(2.0)) #define FUNC_EXP2(x) expl((x) * logl(2.0))
#else #elif (defined(HAVE_EXP) && defined(HAVE_LOG))
#if (defined(HAVE_EXP) && defined(HAVE_LOG))
#define FUNC_EXP2(x) (long double)exp((x) * log(2.0)) #define FUNC_EXP2(x) (long double)exp((x) * log(2.0))
#endif /* defined(HAVE_EXP) && defined(HAVE_LOG) */ #endif
#endif /* defined(HAVE_EXPL) && defined(HAVE_LOGL) */
#endif /* defined(HAVE_EXP2L) */
#ifdef HAVE_EXP10L #ifdef HAVE_EXP10L
#define FUNC_EXP10 exp10l #define FUNC_EXP10 exp10l
#else #elif (defined(HAVE_EXPL) && defined(HAVE_LOGL))
#if (defined(HAVE_EXPL) && defined(HAVE_LOGL))
#define FUNC_EXP10(x) expl((x) * logl(10.0)) #define FUNC_EXP10(x) expl((x) * logl(10.0))
#else #elif (defined(HAVE_EXP) && defined(HAVE_LOG))
#if (defined(HAVE_EXP) && defined(HAVE_LOG))
#define FUNC_EXP10(x) (long double)exp((x) * log(10.0)) #define FUNC_EXP10(x) (long double)exp((x) * log(10.0))
#endif /* defined(HAVE_EXP) && defined(HAVE_LOG) */ #endif
#endif /* defined(HAVE_EXPL) && defined(HAVE_LOGL) */
#endif /* defined(HAVE_EXP10L) */
#ifdef HAVE_LOG2L #ifdef HAVE_LOG2L
#define FUNC_LOG2 log2l #define FUNC_LOG2 log2l
#else #elif defined(HAVE_LOGL)
#ifdef HAVE_LOGL
#define FUNC_LOG2(x) (logl(x) / logl(2.0)) #define FUNC_LOG2(x) (logl(x) / logl(2.0))
#else #elif defined(HAVE_LOG10L)
#ifdef HAVE_LOG #define FUNC_LOG2(x) (log10l(x) / log10l(2.0))
#elif defined(HAVE_LOG2)
#define FUNC_LOG2 (long double)log2
#elif defined(HAVE_LOG)
#define FUNC_LOG2(x) ((long double)log(x) / log(2.0)) #define FUNC_LOG2(x) ((long double)log(x) / log(2.0))
#endif /* defined(HAVE_LOG) */ #endif
#endif /* defined(HAVE_LOGL) */
#endif /* defined(HAVE_LOG2L) */
#ifdef HAVE_LOG10L #ifdef HAVE_LOG10L
#define FUNC_LOG10 log10l #define FUNC_LOG10 log10l
#else #elif defined(HAVE_LOGL)
#ifdef HAVE_LOGL
#define FUNC_LOG10(x) (logl(x) / logl(10.0)) #define FUNC_LOG10(x) (logl(x) / logl(10.0))
#else #elif defined(HAVE_LOG2L)
#ifdef HAVE_LOG #define FUNC_LOG10(x) (log2l(x) / log2l(10.0))
#elif defined(HAVE_LOG10)
#define FUNC_LOG10(x) (long double)log10(x)
#elif defined(HAVE_LOG)
#define FUNC_LOG10(x) ((long double)log(x) / log(10.0)) #define FUNC_LOG10(x) ((long double)log(x) / log(10.0))
#endif /* defined(HAVE_LOG) */ #endif
#endif /* defined(HAVE_LOGL) */
#endif /* defined(HAVE_LOG10L) */
#include <stdlib.h> #include <stdlib.h>
@@ -555,13 +469,13 @@ int ast_yyerror(const char *,YYLTYPE *, struct parse_io *);
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 414 "../main/ast_expr2.y" #line 330 "../main/ast_expr2.y"
{ {
struct val *val; struct val *val;
struct expr_node *arglist; struct expr_node *arglist;
} }
/* Line 187 of yacc.c. */ /* Line 187 of yacc.c. */
#line 563 "../main/ast_expr2.c" #line 479 "../main/ast_expr2.c"
YYSTYPE; YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
@@ -583,13 +497,13 @@ typedef struct YYLTYPE
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
#line 419 "../main/ast_expr2.y" #line 335 "../main/ast_expr2.y"
extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t)); extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
/* Line 216 of yacc.c. */ /* Line 216 of yacc.c. */
#line 591 "../main/ast_expr2.c" #line 507 "../main/ast_expr2.c"
#ifdef short #ifdef short
# undef short # undef short
@@ -885,9 +799,9 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 445, 445, 453, 460, 461, 470, 476, 477, 481, 0, 361, 361, 369, 376, 377, 386, 392, 393, 397,
485, 489, 493, 497, 501, 505, 509, 513, 517, 521, 401, 405, 409, 413, 417, 421, 425, 429, 433, 437,
525, 529, 533, 537, 541, 545, 549 441, 445, 449, 453, 457, 461, 465
}; };
#endif #endif
@@ -1540,114 +1454,114 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp)
switch (yytype) switch (yytype)
{ {
case 4: /* "TOK_COLONCOLON" */ case 4: /* "TOK_COLONCOLON" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1544 "../main/ast_expr2.c" #line 1460 "../main/ast_expr2.c"
break; break;
case 5: /* "TOK_COND" */ case 5: /* "TOK_COND" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1549 "../main/ast_expr2.c" #line 1465 "../main/ast_expr2.c"
break; break;
case 6: /* "TOK_OR" */ case 6: /* "TOK_OR" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1554 "../main/ast_expr2.c" #line 1470 "../main/ast_expr2.c"
break; break;
case 7: /* "TOK_AND" */ case 7: /* "TOK_AND" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1559 "../main/ast_expr2.c" #line 1475 "../main/ast_expr2.c"
break; break;
case 8: /* "TOK_NE" */ case 8: /* "TOK_NE" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1564 "../main/ast_expr2.c" #line 1480 "../main/ast_expr2.c"
break; break;
case 9: /* "TOK_LE" */ case 9: /* "TOK_LE" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1569 "../main/ast_expr2.c" #line 1485 "../main/ast_expr2.c"
break; break;
case 10: /* "TOK_GE" */ case 10: /* "TOK_GE" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1574 "../main/ast_expr2.c" #line 1490 "../main/ast_expr2.c"
break; break;
case 11: /* "TOK_LT" */ case 11: /* "TOK_LT" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1579 "../main/ast_expr2.c" #line 1495 "../main/ast_expr2.c"
break; break;
case 12: /* "TOK_GT" */ case 12: /* "TOK_GT" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1584 "../main/ast_expr2.c" #line 1500 "../main/ast_expr2.c"
break; break;
case 13: /* "TOK_EQ" */ case 13: /* "TOK_EQ" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1589 "../main/ast_expr2.c" #line 1505 "../main/ast_expr2.c"
break; break;
case 14: /* "TOK_MINUS" */ case 14: /* "TOK_MINUS" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1594 "../main/ast_expr2.c" #line 1510 "../main/ast_expr2.c"
break; break;
case 15: /* "TOK_PLUS" */ case 15: /* "TOK_PLUS" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1599 "../main/ast_expr2.c" #line 1515 "../main/ast_expr2.c"
break; break;
case 16: /* "TOK_MOD" */ case 16: /* "TOK_MOD" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1604 "../main/ast_expr2.c" #line 1520 "../main/ast_expr2.c"
break; break;
case 17: /* "TOK_DIV" */ case 17: /* "TOK_DIV" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1609 "../main/ast_expr2.c" #line 1525 "../main/ast_expr2.c"
break; break;
case 18: /* "TOK_MULT" */ case 18: /* "TOK_MULT" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1614 "../main/ast_expr2.c" #line 1530 "../main/ast_expr2.c"
break; break;
case 19: /* "TOK_COMPL" */ case 19: /* "TOK_COMPL" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1619 "../main/ast_expr2.c" #line 1535 "../main/ast_expr2.c"
break; break;
case 20: /* "TOK_EQTILDE" */ case 20: /* "TOK_EQTILDE" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1624 "../main/ast_expr2.c" #line 1540 "../main/ast_expr2.c"
break; break;
case 21: /* "TOK_COLON" */ case 21: /* "TOK_COLON" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1629 "../main/ast_expr2.c" #line 1545 "../main/ast_expr2.c"
break; break;
case 22: /* "TOK_LP" */ case 22: /* "TOK_LP" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1634 "../main/ast_expr2.c" #line 1550 "../main/ast_expr2.c"
break; break;
case 23: /* "TOK_RP" */ case 23: /* "TOK_RP" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1639 "../main/ast_expr2.c" #line 1555 "../main/ast_expr2.c"
break; break;
case 24: /* "TOKEN" */ case 24: /* "TOKEN" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1644 "../main/ast_expr2.c" #line 1560 "../main/ast_expr2.c"
break; break;
case 28: /* "expr" */ case 28: /* "expr" */
#line 439 "../main/ast_expr2.y" #line 355 "../main/ast_expr2.y"
{ free_value((yyvaluep->val)); }; { free_value((yyvaluep->val)); };
#line 1649 "../main/ast_expr2.c" #line 1565 "../main/ast_expr2.c"
break; break;
default: default:
@@ -1970,7 +1884,7 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 2: case 2:
#line 445 "../main/ast_expr2.y" #line 361 "../main/ast_expr2.y"
{ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1); { ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
((struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].val)->type; ((struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].val)->type;
if( (yyvsp[(1) - (1)].val)->type == AST_EXPR_number ) if( (yyvsp[(1) - (1)].val)->type == AST_EXPR_number )
@@ -1982,7 +1896,7 @@ yyreduce:
break; break;
case 3: case 3:
#line 453 "../main/ast_expr2.y" #line 369 "../main/ast_expr2.y"
{/* nothing */ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1); {/* nothing */ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
((struct parse_io *)parseio)->val->type = AST_EXPR_string; ((struct parse_io *)parseio)->val->type = AST_EXPR_string;
((struct parse_io *)parseio)->val->u.s = strdup(""); ((struct parse_io *)parseio)->val->u.s = strdup("");
@@ -1990,12 +1904,12 @@ yyreduce:
break; break;
case 4: case 4:
#line 460 "../main/ast_expr2.y" #line 376 "../main/ast_expr2.y"
{ (yyval.arglist) = alloc_expr_node(AST_EXPR_NODE_VAL); (yyval.arglist)->val = (yyvsp[(1) - (1)].val);;} { (yyval.arglist) = alloc_expr_node(AST_EXPR_NODE_VAL); (yyval.arglist)->val = (yyvsp[(1) - (1)].val);;}
break; break;
case 5: case 5:
#line 461 "../main/ast_expr2.y" #line 377 "../main/ast_expr2.y"
{struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL); {struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL);
struct expr_node *t; struct expr_node *t;
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
@@ -2005,7 +1919,7 @@ yyreduce:
break; break;
case 6: case 6:
#line 470 "../main/ast_expr2.y" #line 386 "../main/ast_expr2.y"
{ (yyval.val) = op_func((yyvsp[(1) - (4)].val),(yyvsp[(3) - (4)].arglist), ((struct parse_io *)parseio)->chan); { (yyval.val) = op_func((yyvsp[(1) - (4)].val),(yyvsp[(3) - (4)].arglist), ((struct parse_io *)parseio)->chan);
DESTROY((yyvsp[(2) - (4)].val)); DESTROY((yyvsp[(2) - (4)].val));
DESTROY((yyvsp[(4) - (4)].val)); DESTROY((yyvsp[(4) - (4)].val));
@@ -2015,12 +1929,12 @@ yyreduce:
break; break;
case 7: case 7:
#line 476 "../main/ast_expr2.y" #line 392 "../main/ast_expr2.y"
{(yyval.val) = (yyvsp[(1) - (1)].val);;} {(yyval.val) = (yyvsp[(1) - (1)].val);;}
break; break;
case 8: case 8:
#line 477 "../main/ast_expr2.y" #line 393 "../main/ast_expr2.y"
{ (yyval.val) = (yyvsp[(2) - (3)].val); { (yyval.val) = (yyvsp[(2) - (3)].val);
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0; (yyloc).first_line=0; (yyloc).last_line=0;
@@ -2028,7 +1942,7 @@ yyreduce:
break; break;
case 9: case 9:
#line 481 "../main/ast_expr2.y" #line 397 "../main/ast_expr2.y"
{ (yyval.val) = op_or ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_or ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2036,7 +1950,7 @@ yyreduce:
break; break;
case 10: case 10:
#line 485 "../main/ast_expr2.y" #line 401 "../main/ast_expr2.y"
{ (yyval.val) = op_and ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_and ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2044,7 +1958,7 @@ yyreduce:
break; break;
case 11: case 11:
#line 489 "../main/ast_expr2.y" #line 405 "../main/ast_expr2.y"
{ (yyval.val) = op_eq ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_eq ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2052,7 +1966,7 @@ yyreduce:
break; break;
case 12: case 12:
#line 493 "../main/ast_expr2.y" #line 409 "../main/ast_expr2.y"
{ (yyval.val) = op_gt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_gt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2060,7 +1974,7 @@ yyreduce:
break; break;
case 13: case 13:
#line 497 "../main/ast_expr2.y" #line 413 "../main/ast_expr2.y"
{ (yyval.val) = op_lt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_lt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2068,7 +1982,7 @@ yyreduce:
break; break;
case 14: case 14:
#line 501 "../main/ast_expr2.y" #line 417 "../main/ast_expr2.y"
{ (yyval.val) = op_ge ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_ge ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2076,7 +1990,7 @@ yyreduce:
break; break;
case 15: case 15:
#line 505 "../main/ast_expr2.y" #line 421 "../main/ast_expr2.y"
{ (yyval.val) = op_le ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_le ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2084,7 +1998,7 @@ yyreduce:
break; break;
case 16: case 16:
#line 509 "../main/ast_expr2.y" #line 425 "../main/ast_expr2.y"
{ (yyval.val) = op_ne ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_ne ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2092,7 +2006,7 @@ yyreduce:
break; break;
case 17: case 17:
#line 513 "../main/ast_expr2.y" #line 429 "../main/ast_expr2.y"
{ (yyval.val) = op_plus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_plus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2100,7 +2014,7 @@ yyreduce:
break; break;
case 18: case 18:
#line 517 "../main/ast_expr2.y" #line 433 "../main/ast_expr2.y"
{ (yyval.val) = op_minus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_minus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2108,7 +2022,7 @@ yyreduce:
break; break;
case 19: case 19:
#line 521 "../main/ast_expr2.y" #line 437 "../main/ast_expr2.y"
{ (yyval.val) = op_negate ((yyvsp[(2) - (2)].val)); { (yyval.val) = op_negate ((yyvsp[(2) - (2)].val));
DESTROY((yyvsp[(1) - (2)].val)); DESTROY((yyvsp[(1) - (2)].val));
(yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column; (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
@@ -2116,7 +2030,7 @@ yyreduce:
break; break;
case 20: case 20:
#line 525 "../main/ast_expr2.y" #line 441 "../main/ast_expr2.y"
{ (yyval.val) = op_compl ((yyvsp[(2) - (2)].val)); { (yyval.val) = op_compl ((yyvsp[(2) - (2)].val));
DESTROY((yyvsp[(1) - (2)].val)); DESTROY((yyvsp[(1) - (2)].val));
(yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column; (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
@@ -2124,7 +2038,7 @@ yyreduce:
break; break;
case 21: case 21:
#line 529 "../main/ast_expr2.y" #line 445 "../main/ast_expr2.y"
{ (yyval.val) = op_times ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_times ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2132,7 +2046,7 @@ yyreduce:
break; break;
case 22: case 22:
#line 533 "../main/ast_expr2.y" #line 449 "../main/ast_expr2.y"
{ (yyval.val) = op_div ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_div ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2140,7 +2054,7 @@ yyreduce:
break; break;
case 23: case 23:
#line 537 "../main/ast_expr2.y" #line 453 "../main/ast_expr2.y"
{ (yyval.val) = op_rem ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_rem ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2148,7 +2062,7 @@ yyreduce:
break; break;
case 24: case 24:
#line 541 "../main/ast_expr2.y" #line 457 "../main/ast_expr2.y"
{ (yyval.val) = op_colon ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_colon ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2156,7 +2070,7 @@ yyreduce:
break; break;
case 25: case 25:
#line 545 "../main/ast_expr2.y" #line 461 "../main/ast_expr2.y"
{ (yyval.val) = op_eqtilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); { (yyval.val) = op_eqtilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val)); DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -2164,7 +2078,7 @@ yyreduce:
break; break;
case 26: case 26:
#line 549 "../main/ast_expr2.y" #line 465 "../main/ast_expr2.y"
{ (yyval.val) = op_cond ((yyvsp[(1) - (5)].val), (yyvsp[(3) - (5)].val), (yyvsp[(5) - (5)].val)); { (yyval.val) = op_cond ((yyvsp[(1) - (5)].val), (yyvsp[(3) - (5)].val), (yyvsp[(5) - (5)].val));
DESTROY((yyvsp[(2) - (5)].val)); DESTROY((yyvsp[(2) - (5)].val));
DESTROY((yyvsp[(4) - (5)].val)); DESTROY((yyvsp[(4) - (5)].val));
@@ -2174,7 +2088,7 @@ yyreduce:
/* Line 1267 of yacc.c. */ /* Line 1267 of yacc.c. */
#line 2176 "../main/ast_expr2.c" #line 2092 "../main/ast_expr2.c"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2394,7 +2308,7 @@ yyreturn:
} }
#line 556 "../main/ast_expr2.y" #line 472 "../main/ast_expr2.y"
static struct expr_node *alloc_expr_node(enum node_type nt) static struct expr_node *alloc_expr_node(enum node_type nt)

View File

@@ -92,7 +92,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 414 "../main/ast_expr2.y" #line 330 "../main/ast_expr2.y"
{ {
struct val *val; struct val *val;
struct expr_node *arglist; struct expr_node *arglist;

View File

@@ -21,193 +21,117 @@
#ifdef HAVE_COSL #ifdef HAVE_COSL
#define FUNC_COS cosl #define FUNC_COS cosl
#else #elif defined(HAVE_COS)
#ifdef HAVE_COS
#define FUNC_COS (long double)cos #define FUNC_COS (long double)cos
#else
#undef FUNC_COS
#endif
#endif #endif
#ifdef HAVE_SINL #ifdef HAVE_SINL
#define FUNC_SIN sinl #define FUNC_SIN sinl
#else #elif defined(HAVE_SIN)
#ifdef HAVE_SIN
#define FUNC_SIN (long double)sin #define FUNC_SIN (long double)sin
#else
#undef FUNC_SIN
#endif
#endif #endif
#ifdef HAVE_TANL #ifdef HAVE_TANL
#define FUNC_TAN tanl #define FUNC_TAN tanl
#else #elif defined(HAVE_TAN)
#ifdef HAVE_TAN
#define FUNC_TAN (long double)tan #define FUNC_TAN (long double)tan
#else
#undef FUNC_TAN
#endif
#endif #endif
#ifdef HAVE_ACOSL #ifdef HAVE_ACOSL
#define FUNC_ACOS acosl #define FUNC_ACOS acosl
#else #elif defined(HAVE_ACOS)
#ifdef HAVE_ACOS
#define FUNC_ACOS (long double)acos #define FUNC_ACOS (long double)acos
#else
#undef FUNC_ACOS
#endif
#endif #endif
#ifdef HAVE_ASINL #ifdef HAVE_ASINL
#define FUNC_ASIN asinl #define FUNC_ASIN asinl
#else #elif defined(HAVE_ASIN)
#ifdef HAVE_ASIN
#define FUNC_ASIN (long double)asin #define FUNC_ASIN (long double)asin
#else
#undef FUNC_ASIN
#endif
#endif #endif
#ifdef HAVE_ATANL #ifdef HAVE_ATANL
#define FUNC_ATAN atanl #define FUNC_ATAN atanl
#else #elif defined(HAVE_ATAN)
#ifdef HAVE_ATAN
#define FUNC_ATAN (long double)atan #define FUNC_ATAN (long double)atan
#else
#undef FUNC_ATAN
#endif
#endif #endif
#ifdef HAVE_ATAN2L #ifdef HAVE_ATAN2L
#define FUNC_ATAN2 atan2l #define FUNC_ATAN2 atan2l
#else #elif defined(HAVE_ATAN2)
#ifdef HAVE_ATAN2
#define FUNC_ATAN2 (long double)atan2 #define FUNC_ATAN2 (long double)atan2
#else
#undef FUNC_ATAN2
#endif
#endif #endif
#ifdef HAVE_POWL #ifdef HAVE_POWL
#define FUNC_POW powl #define FUNC_POW powl
#else #elif defined(HAVE_POW)
#ifdef HAVE_POW
#define FUNC_POW (long double)pow #define FUNC_POW (long double)pow
#else
#undef FUNC_POW
#endif
#endif #endif
#ifdef HAVE_SQRTL #ifdef HAVE_SQRTL
#define FUNC_SQRT sqrtl #define FUNC_SQRT sqrtl
#else #elif defined(HAVE_SQRT)
#ifdef HAVE_SQRT
#define FUNC_SQRT (long double)sqrt #define FUNC_SQRT (long double)sqrt
#else
#undef FUNC_SQRT
#endif
#endif #endif
#ifdef HAVE_RINTL #ifdef HAVE_RINTL
#define FUNC_RINT rintl #define FUNC_RINT rintl
#else #elif defined(HAVE_RINT)
#ifdef HAVE_RINT
#define FUNC_RINT (long double)rint #define FUNC_RINT (long double)rint
#else
#undef FUNC_RINT
#endif
#endif #endif
#ifdef HAVE_EXPL #ifdef HAVE_EXPL
#define FUNC_EXP expl #define FUNC_EXP expl
#else #elif defined(HAVE_EXP)
#ifdef HAVE_EXP
#define FUNC_EXP (long double)exp #define FUNC_EXP (long double)exp
#else
#undef FUNC_EXP
#endif
#endif #endif
#ifdef HAVE_LOGL #ifdef HAVE_LOGL
#define FUNC_LOG logl #define FUNC_LOG logl
#else #elif defined(HAVE_LOG)
#ifdef HAVE_LOG
#define FUNC_LOG (long double)log #define FUNC_LOG (long double)log
#else
#undef FUNC_LOG
#endif
#endif #endif
#ifdef HAVE_REMINDERL #ifdef HAVE_REMINDERL
#define FUNC_REMINDER reminderl #define FUNC_REMINDER reminderl
#else #elif defined(HAVE_REMINDER)
#ifdef HAVE_REMINDER
#define FUNC_REMINDER (long double)reminder #define FUNC_REMINDER (long double)reminder
#else
#undef FUNC_REMINDER
#endif
#endif #endif
#ifdef HAVE_FMODL #ifdef HAVE_FMODL
#define FUNC_FMOD fmodl #define FUNC_FMOD fmodl
#else #elif defined(HAVE_FMOD)
#ifdef HAVE_FMOD
#define FUNC_FMOD (long double)fmod #define FUNC_FMOD (long double)fmod
#else
#undef FUNC_FMOD
#endif
#endif #endif
#ifdef HAVE_STRTOLD #ifdef HAVE_STRTOLD
#define FUNC_STRTOD strtold #define FUNC_STRTOD strtold
#else #elif defined(HAVE_STRTOD)
#ifdef HAVE_STRTOD
#define FUNC_STRTOD (long double)strtod #define FUNC_STRTOD (long double)strtod
#else
#undef FUNC_STRTOD
#endif
#endif #endif
#ifdef HAVE_FLOORL #ifdef HAVE_FLOORL
#define FUNC_FLOOR floorl #define FUNC_FLOOR floorl
#else #elif defined(HAVE_FLOOR)
#ifdef HAVE_FLOOR
#define FUNC_FLOOR (long double)floor #define FUNC_FLOOR (long double)floor
#else #endif
#undef FUNC_FLOOR
#endif /* defined(HAVE_FLOOR) */
#endif /* defined(HAVE_FLOORL) */
#ifdef HAVE_CEILL #ifdef HAVE_CEILL
#define FUNC_CEIL ceill #define FUNC_CEIL ceill
#else #elif defined(HAVE_CEIL)
#ifdef HAVE_CEIL
#define FUNC_CEIL (long double)ceil #define FUNC_CEIL (long double)ceil
#else #endif
#undef FUNC_CEIL
#endif /* defined(HAVE_CEIL) */
#endif /* defined(HAVE_CEILL) */
#ifdef HAVE_ROUNDL #ifdef HAVE_ROUNDL
#define FUNC_ROUND roundl #define FUNC_ROUND roundl
#else /* HAVE_ROUNDL */ #elif defined(HAVE_ROUND)
#ifdef HAVE_ROUND
#define FUNC_ROUND (long double)round #define FUNC_ROUND (long double)round
#else /* HAVE_ROUND */ #endif
#undef FUNC_ROUND
#endif /* HAVE_ROUND */
#endif /* HAVE_ROUNDL */
#ifdef HAVE_TRUNCL #ifdef HAVE_TRUNCL
#define FUNC_TRUNC truncl #define FUNC_TRUNC truncl
#else /* HAVE_TRUNCL */ #elif defined(HAVE_TRUNC)
#ifdef HAVE_TRUNC
#define FUNC_TRUNC (long double)trunc #define FUNC_TRUNC (long double)trunc
#else /* HAVE_TRUNC */ #endif
#undef FUNC_TRUNC
#endif /* HAVE_TRUNC */
#endif /* HAVE_TRUNCL */
/*! \note /*! \note
* Oddly enough, some platforms have some ISO C99 functions, but not others, so * Oddly enough, some platforms have some ISO C99 functions, but not others, so
@@ -215,51 +139,43 @@
*/ */
#ifdef HAVE_EXP2L #ifdef HAVE_EXP2L
#define FUNC_EXP2 exp2l #define FUNC_EXP2 exp2l
#else #elif (defined(HAVE_EXPL) && defined(HAVE_LOGL))
#if (defined(HAVE_EXPL) && defined(HAVE_LOGL))
#define FUNC_EXP2(x) expl((x) * logl(2.0)) #define FUNC_EXP2(x) expl((x) * logl(2.0))
#else #elif (defined(HAVE_EXP) && defined(HAVE_LOG))
#if (defined(HAVE_EXP) && defined(HAVE_LOG))
#define FUNC_EXP2(x) (long double)exp((x) * log(2.0)) #define FUNC_EXP2(x) (long double)exp((x) * log(2.0))
#endif /* defined(HAVE_EXP) && defined(HAVE_LOG) */ #endif
#endif /* defined(HAVE_EXPL) && defined(HAVE_LOGL) */
#endif /* defined(HAVE_EXP2L) */
#ifdef HAVE_EXP10L #ifdef HAVE_EXP10L
#define FUNC_EXP10 exp10l #define FUNC_EXP10 exp10l
#else #elif (defined(HAVE_EXPL) && defined(HAVE_LOGL))
#if (defined(HAVE_EXPL) && defined(HAVE_LOGL))
#define FUNC_EXP10(x) expl((x) * logl(10.0)) #define FUNC_EXP10(x) expl((x) * logl(10.0))
#else #elif (defined(HAVE_EXP) && defined(HAVE_LOG))
#if (defined(HAVE_EXP) && defined(HAVE_LOG))
#define FUNC_EXP10(x) (long double)exp((x) * log(10.0)) #define FUNC_EXP10(x) (long double)exp((x) * log(10.0))
#endif /* defined(HAVE_EXP) && defined(HAVE_LOG) */ #endif
#endif /* defined(HAVE_EXPL) && defined(HAVE_LOGL) */
#endif /* defined(HAVE_EXP10L) */
#ifdef HAVE_LOG2L #ifdef HAVE_LOG2L
#define FUNC_LOG2 log2l #define FUNC_LOG2 log2l
#else #elif defined(HAVE_LOGL)
#ifdef HAVE_LOGL
#define FUNC_LOG2(x) (logl(x) / logl(2.0)) #define FUNC_LOG2(x) (logl(x) / logl(2.0))
#else #elif defined(HAVE_LOG10L)
#ifdef HAVE_LOG #define FUNC_LOG2(x) (log10l(x) / log10l(2.0))
#elif defined(HAVE_LOG2)
#define FUNC_LOG2 (long double)log2
#elif defined(HAVE_LOG)
#define FUNC_LOG2(x) ((long double)log(x) / log(2.0)) #define FUNC_LOG2(x) ((long double)log(x) / log(2.0))
#endif /* defined(HAVE_LOG) */ #endif
#endif /* defined(HAVE_LOGL) */
#endif /* defined(HAVE_LOG2L) */
#ifdef HAVE_LOG10L #ifdef HAVE_LOG10L
#define FUNC_LOG10 log10l #define FUNC_LOG10 log10l
#else #elif defined(HAVE_LOGL)
#ifdef HAVE_LOGL
#define FUNC_LOG10(x) (logl(x) / logl(10.0)) #define FUNC_LOG10(x) (logl(x) / logl(10.0))
#else #elif defined(HAVE_LOG2L)
#ifdef HAVE_LOG #define FUNC_LOG10(x) (log2l(x) / log2l(10.0))
#elif defined(HAVE_LOG10)
#define FUNC_LOG10(x) (long double)log10(x)
#elif defined(HAVE_LOG)
#define FUNC_LOG10(x) ((long double)log(x) / log(10.0)) #define FUNC_LOG10(x) ((long double)log(x) / log(10.0))
#endif /* defined(HAVE_LOG) */ #endif
#endif /* defined(HAVE_LOGL) */
#endif /* defined(HAVE_LOG10L) */
#include <stdlib.h> #include <stdlib.h>