diff options
-rw-r--r-- | src/gen.rs | 6 | ||||
-rw-r--r-- | src/parser.rs | 4 | ||||
-rw-r--r-- | tests/headers/class_with_inner_struct.hpp | 26 |
3 files changed, 31 insertions, 5 deletions
@@ -1571,9 +1571,9 @@ fn gen_comp_methods(ctx: &mut GenCtx, data_field: &str, data_offset: usize, f.ty.size() } CompMember::Comp(ref rc_c) => { - let c = &rc_c.borrow(); - methods.extend(gen_comp_methods(ctx, data_field, offset, c.kind, - &c.members, extra).into_iter()); + let c = rc_c.borrow(); + let name = comp_name(&ctx, c.kind, &c.name); + extra.extend(comp_to_rs(ctx, &name, c.clone()).into_iter()); c.layout.size } CompMember::CompField(ref rc_c, ref f) => { diff --git a/src/parser.rs b/src/parser.rs index a5c5bc51..600b14a7 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -552,8 +552,8 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor, match ty { il::TInt(_, _) => (), _ => { - let msg = format!("Enums in bitfields are not supported ({}.{}).", - cursor.spelling(), parent.spelling()); + let msg = format!("Enums in bitfields are not supported ({}::{}).", + parent.spelling(), cursor.spelling()); ctx.logger.warn(&msg); } } diff --git a/tests/headers/class_with_inner_struct.hpp b/tests/headers/class_with_inner_struct.hpp index 5f57a1c0..7d7e98f1 100644 --- a/tests/headers/class_with_inner_struct.hpp +++ b/tests/headers/class_with_inner_struct.hpp @@ -13,3 +13,29 @@ class B { unsigned d; struct Segment { int begin, end; }; }; + + +enum class StepSyntax { + Keyword, // step-start and step-end + FunctionalWithoutKeyword, // steps(...) + FunctionalWithStartKeyword, // steps(..., start) + FunctionalWithEndKeyword, // steps(..., end) +}; + +class C { + unsigned d; + union { + struct { + float mX1; + float mY1; + float mX2; + float mY2; + } mFunc; + struct { + StepSyntax mStepSyntax; + unsigned int mSteps; + }; + }; + // To ensure it doesn't collide + struct Segment { int begin, end; }; +}; |