From b091cdec787d09c772602767311bb1cd05e80b1c Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 16 Jul 2021 22:46:40 +0200 Subject: [PATCH] Change nan / infinity. --- src/compiler/sema_expr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index 05c6e7431..0bf4eba62 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -2018,7 +2018,11 @@ static inline bool sema_expr_analyse_type_access(Expr *expr, TypeInfo *parent, b { expr->expr_kind = EXPR_CONST; expr->const_expr.kind = canonical->type_kind; +#if LONG_DOUBLE expr->const_expr.f = nanl(""); +#else + expr->const_expr.f = nan(""); +#endif expr_set_type(expr, parent->type); expr->constant = true; expr->pure = true; @@ -2029,7 +2033,7 @@ static inline bool sema_expr_analyse_type_access(Expr *expr, TypeInfo *parent, b { expr->expr_kind = EXPR_CONST; expr->const_expr.kind = parent->type->canonical->type_kind; - expr->const_expr.f = HUGE_VALL; + expr->const_expr.f = INFINITY; expr_set_type(expr, parent->type->canonical); expr->constant = true; expr->pure = true;