Make sure to actually generate the empty struct declaration
parent
1c6d51f271
commit
892c948a44
|
@ -55,7 +55,7 @@ CommonCHeaders = '
|
||||||
|
|
||||||
// MSVC cannot parse some things properly
|
// MSVC cannot parse some things properly
|
||||||
#undef EMPTY_STRUCT_DECLARATION
|
#undef EMPTY_STRUCT_DECLARATION
|
||||||
#define EMPTY_STRUCT_DECLARATION void *____dummy_variable;
|
#define EMPTY_STRUCT_DECLARATION void *____dummy_variable
|
||||||
#undef OPTION_CAST
|
#undef OPTION_CAST
|
||||||
#define OPTION_CAST(x)
|
#define OPTION_CAST(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -637,6 +637,7 @@ fn (p mut Parser) struct_decl() {
|
||||||
if attr == 'raw' && field_type != 'string' {
|
if attr == 'raw' && field_type != 'string' {
|
||||||
p.error('struct field with attribute "raw" should be of type "string" but got "$field_type"')
|
p.error('struct field with attribute "raw" should be of type "string" but got "$field_type"')
|
||||||
}
|
}
|
||||||
|
|
||||||
did_gen_something = true
|
did_gen_something = true
|
||||||
if p.first_pass() {
|
if p.first_pass() {
|
||||||
p.table.add_field(typ.name, field_name, field_type, is_mut, attr, access_mod)
|
p.table.add_field(typ.name, field_name, field_type, is_mut, attr, access_mod)
|
||||||
|
@ -644,6 +645,13 @@ fn (p mut Parser) struct_decl() {
|
||||||
p.fgenln('')
|
p.fgenln('')
|
||||||
}
|
}
|
||||||
p.check(.rcbr)
|
p.check(.rcbr)
|
||||||
|
if !is_c {
|
||||||
|
if !did_gen_something {
|
||||||
|
if p.first_pass() {
|
||||||
|
p.table.add_field(typ.name, '', 'EMPTY_STRUCT_DECLARATION', false, '', .private)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
p.fgenln('\n')
|
p.fgenln('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue