mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix [packed] struct support for tcc
This commit is contained in:
parent
5e1a2f6f50
commit
dd78620b31
@ -2025,13 +2025,6 @@ fn (mut g Gen) stmt(node ast.Stmt) {
|
||||
if node.is_union {
|
||||
g.typedefs.writeln('typedef union $name $name;')
|
||||
} else {
|
||||
/*
|
||||
attrs := if node.attrs.contains('packed') {
|
||||
'__attribute__((__packed__))'
|
||||
} else {
|
||||
''
|
||||
}
|
||||
*/
|
||||
g.typedefs.writeln('typedef struct $name $name;')
|
||||
}
|
||||
}
|
||||
|
@ -313,6 +313,10 @@ fn (mut g Gen) struct_decl(s ast.Struct, name string, is_anon bool) {
|
||||
pre_pragma += '#pragma pack(push, $attr.arg)\n'
|
||||
post_pragma += '#pragma pack(pop)'
|
||||
}
|
||||
'packed' {
|
||||
pre_pragma += '#pragma pack(push, 1)\n'
|
||||
post_pragma += '#pragma pack(pop)'
|
||||
}
|
||||
else {}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user