From 1e88fec72cf1e7b864cbb015543dfb144557c254 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 20 Jan 2025 01:33:18 +0900 Subject: [PATCH] [qfcc] Promote enums so they can be used in math --- tools/qfcc/source/expr_binary.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/qfcc/source/expr_binary.c b/tools/qfcc/source/expr_binary.c index a5ba2f1f6..05cccabc5 100644 --- a/tools/qfcc/source/expr_binary.c +++ b/tools/qfcc/source/expr_binary.c @@ -186,6 +186,10 @@ promote_exprs (const expr_t **e1, const expr_t **e2) //FIXME proper backing type for enum like handle t1 = type_default; t2 = type_default; + } else if (is_math (t1) && is_enum (t2)) { + t2 = promote_type (t1, t2); + } else if (is_math (t2) && is_enum (t1)) { + t1 = promote_type (t2, t1); } else if ((is_vector (t1) || is_quaternion (t1)) && (is_float (t2) || is_bool (t2))) { t2 = promote_type (t1, t2);