Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Sep 30, 2024
1 parent d66e924 commit 3ee57d0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -7353,8 +7353,7 @@ fn (mut g Gen) type_default(typ_ ast.Type) string {
'{'
}
$if windows {
if g.pref.ccompiler_type == .tinyc && !typ.has_flag(.shared_f)
&& g.inside_global_decl {
if !typ.has_flag(.shared_f) && g.inside_global_decl {
init_str = '(${g.typ(typ)}){'
}
}
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions vlib/v/gen/c/testdata/global_initializer_windows.must_have
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Array_fixed_main__Foo_3 g_test_foo = {(main__Foo){.foo = 0,.bar = (main___VAnonStruct1){.a = 0,.b = 0,},}, (main__Foo){.foo = 0,.bar = (main___VAnonStruct1){.a = 0,.b = 0,},}, (main__Foo){.foo = 0,.bar = (main___VAnonStruct1){.a = 0,.b = 0,},}}; // global4
11 changes: 11 additions & 0 deletions vlib/v/gen/c/testdata/global_initializer_windows.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// vtest vflags: -enable-globals

struct Foo {
foo int
bar struct {
a int
b f64
}
}

__global g_test_foo = [3]Foo{}

0 comments on commit 3ee57d0

Please sign in to comment.