diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index a7a0176ff3..ef472526fc 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -1825,7 +1825,7 @@ fn (mut g Gen) stmt(node ast.Stmt) { g.global_decl(node) } ast.GotoLabel { - g.writeln('${c_name(node.name)}: {}') + g.writeln('${c_name(node.name)}: ') } ast.GotoStmt { g.write_v_source_line_info(node.pos) diff --git a/vlib/v/gen/c/infix.v b/vlib/v/gen/c/infix.v index 782dd332a5..8bd7dfd0f8 100644 --- a/vlib/v/gen/c/infix.v +++ b/vlib/v/gen/c/infix.v @@ -87,6 +87,10 @@ fn (mut g Gen) infix_expr_eq_op(node ast.InfixExpr) { right := g.unwrap(node.right_type) has_defined_eq_operator := g.table.has_method(left.sym, '==') has_alias_eq_op_overload := left.sym.info is ast.Alias && left.sym.has_method('==') + if g.pref.translated && !g.is_builtin_mod { + g.gen_plain_infix_expr(node) + return + } if (left.typ.is_ptr() && right.typ.is_int()) || (right.typ.is_ptr() && left.typ.is_int()) { g.gen_plain_infix_expr(node) } else if (left.typ.idx() == ast.string_type_idx || (!has_defined_eq_operator @@ -291,6 +295,10 @@ fn (mut g Gen) infix_expr_cmp_op(node ast.InfixExpr) { left := g.unwrap(node.left_type) right := g.unwrap(node.right_type) has_operator_overloading := g.table.has_method(left.sym, '<') + if g.pref.translated && !g.is_builtin_mod { + g.gen_plain_infix_expr(node) + return + } if left.sym.kind == .struct_ && (left.sym.info as ast.Struct).generic_types.len > 0 { if node.op in [.le, .ge] { g.write('!')