@@ -1043,7 +1043,9 @@ fn structure_type_string(
1043
1043
include_anonymous_def : bool ,
1044
1044
) -> Result < TypeString > {
1045
1045
let prefix = if let Some ( name) = t. name . as_ref ( ) {
1046
- if include_keyword {
1046
+ if name. starts_with ( '@' ) {
1047
+ struct_def_string ( info, typedefs, t) ?
1048
+ } else if include_keyword {
1047
1049
match t. kind {
1048
1050
StructureKind :: Struct => format ! ( "struct {}" , name) ,
1049
1051
StructureKind :: Class => format ! ( "class {}" , name) ,
@@ -1075,7 +1077,9 @@ fn enumeration_type_string(
1075
1077
include_anonymous_def : bool ,
1076
1078
) -> Result < TypeString > {
1077
1079
let prefix = if let Some ( name) = t. name . as_ref ( ) {
1078
- if include_keyword {
1080
+ if name. starts_with ( '@' ) {
1081
+ enum_def_string ( t) ?
1082
+ } else if include_keyword {
1079
1083
format ! ( "enum {}" , name)
1080
1084
} else {
1081
1085
name. clone ( )
@@ -1098,7 +1102,9 @@ fn union_type_string(
1098
1102
include_anonymous_def : bool ,
1099
1103
) -> Result < TypeString > {
1100
1104
let prefix = if let Some ( name) = t. name . as_ref ( ) {
1101
- if include_keyword {
1105
+ if name. starts_with ( '@' ) {
1106
+ union_def_string ( info, typedefs, t) ?
1107
+ } else if include_keyword {
1102
1108
format ! ( "union {}" , name)
1103
1109
} else {
1104
1110
name. clone ( )
@@ -1411,7 +1417,11 @@ pub fn struct_def_string(
1411
1417
StructureKind :: Class => "class" . to_string ( ) ,
1412
1418
} ;
1413
1419
if let Some ( name) = t. name . as_ref ( ) {
1414
- write ! ( out, " {}" , name) ?;
1420
+ if name. starts_with ( '@' ) {
1421
+ write ! ( out, " /* {} */" , name) ?;
1422
+ } else {
1423
+ write ! ( out, " {}" , name) ?;
1424
+ }
1415
1425
}
1416
1426
let mut wrote_base = false ;
1417
1427
for base in & t. bases {
@@ -1468,7 +1478,13 @@ pub fn struct_def_string(
1468
1478
1469
1479
pub fn enum_def_string ( t : & EnumerationType ) -> Result < String > {
1470
1480
let mut out = match t. name . as_ref ( ) {
1471
- Some ( name) => format ! ( "enum {} {{\n " , name) ,
1481
+ Some ( name) => {
1482
+ if name. starts_with ( '@' ) {
1483
+ format ! ( "enum /* {} */ {{\n " , name)
1484
+ } else {
1485
+ format ! ( "enum {} {{\n " , name)
1486
+ }
1487
+ }
1472
1488
None => "enum {\n " . to_string ( ) ,
1473
1489
} ;
1474
1490
for member in t. members . iter ( ) {
@@ -1480,7 +1496,13 @@ pub fn enum_def_string(t: &EnumerationType) -> Result<String> {
1480
1496
1481
1497
pub fn union_def_string ( info : & DwarfInfo , typedefs : & TypedefMap , t : & UnionType ) -> Result < String > {
1482
1498
let mut out = match t. name . as_ref ( ) {
1483
- Some ( name) => format ! ( "union {} {{\n " , name) ,
1499
+ Some ( name) => {
1500
+ if name. starts_with ( '@' ) {
1501
+ format ! ( "union /* {} */ {{\n " , name)
1502
+ } else {
1503
+ format ! ( "union {} {{\n " , name)
1504
+ }
1505
+ }
1484
1506
None => "union {\n " . to_string ( ) ,
1485
1507
} ;
1486
1508
let mut var_out = String :: new ( ) ;
0 commit comments