1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen,ci: fix v -usecache self on macos

This commit is contained in:
Delyan Angelov 2022-07-22 11:43:20 +03:00
parent f75d7eb114
commit c6aea659e3

View File

@ -4723,7 +4723,7 @@ fn (mut g Gen) global_decl(node ast.GlobalDecl) {
def_builder.write_string(' = ${g.expr_string(field.expr)}')
} else if (field.expr.is_literal() && should_init) || cinit
|| (field.expr is ast.ArrayInit && (field.expr as ast.ArrayInit).is_fixed)
|| is_simple_unsafe_expr {
|| (is_simple_unsafe_expr && should_init) {
// Simple literals can be initialized right away in global scope in C.
// e.g. `int myglobal = 10;`
def_builder.write_string(' = ${g.expr_string(field.expr)}')