summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <me@emiliocobos.me>2016-04-15 19:08:46 +0200
committerEmilio Cobos Álvarez <me@emiliocobos.me>2016-04-15 19:08:46 +0200
commitb19941060b002e0806ffa0232439d053934e9102 (patch)
treebde5f8e71516297f09a50bf19843c8a9d91bc8bd
parenteb75c101032184a24b752dddd3a0af35f7de3da0 (diff)
parser: Add hack for opaque typedef struct xxx { } xxx;
-rw-r--r--src/parser.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 32a35afe..eace81dd 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -1013,6 +1013,13 @@ fn visit_top(cursor: &Cursor,
if cursor.spelling() ==
cursor.typedef_type().declaration().spelling() {
+ // XXX: This is a real hack, but in the common idiom of:
+ // typedef struct xxx { ... } xxx;
+ //
+ // The annotation arrives here, so...
+ if anno.opaque {
+ ctx.options.opaque_types.push(cursor.spelling());
+ }
return CXChildVisit_Continue;
}
let ty = conv_ty(ctx, &under_ty, cursor);