pref,cgen: turn off [minify] struct field reordering, when -cross is used (stabler vc/v.c and vc/v_win.c, when generated on different hosts)

This commit is contained in:
Delyan Angelov 2023-10-26 05:46:25 +03:00
parent 14618a1b18
commit bdb8b30e4d
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ fn (mut c Checker) struct_decl(mut node ast.StructDecl) {
}
}
}
if struct_sym.info.is_minify {
if struct_sym.info.is_minify && !c.pref.output_cross_c {
node.fields.sort_with_compare(minify_sort_fn)
struct_sym.info.fields.sort_with_compare(minify_sort_fn)
}

View File

@ -510,7 +510,7 @@ fn (mut g Gen) struct_decl(s ast.Struct, name string, is_anon bool) {
field_name := c_name(field.name)
volatile_prefix := if field.is_volatile { 'volatile ' } else { '' }
mut size_suffix := ''
if is_minify && !g.is_cc_msvc {
if is_minify && !g.is_cc_msvc && !g.pref.output_cross_c {
if field.typ == ast.bool_type_idx {
size_suffix = ' : 1'
} else {