mirror of
https://github.com/vlang/v.git
synced 2025-09-18 11:56:57 -04:00
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:
parent
14618a1b18
commit
bdb8b30e4d
@ -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)
|
node.fields.sort_with_compare(minify_sort_fn)
|
||||||
struct_sym.info.fields.sort_with_compare(minify_sort_fn)
|
struct_sym.info.fields.sort_with_compare(minify_sort_fn)
|
||||||
}
|
}
|
||||||
|
@ -510,7 +510,7 @@ fn (mut g Gen) struct_decl(s ast.Struct, name string, is_anon bool) {
|
|||||||
field_name := c_name(field.name)
|
field_name := c_name(field.name)
|
||||||
volatile_prefix := if field.is_volatile { 'volatile ' } else { '' }
|
volatile_prefix := if field.is_volatile { 'volatile ' } else { '' }
|
||||||
mut size_suffix := ''
|
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 {
|
if field.typ == ast.bool_type_idx {
|
||||||
size_suffix = ' : 1'
|
size_suffix = ' : 1'
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user