Skip to content

Commit 97c2f1f

Browse files
committed
Don't expand typedefed function parameter types.
Closes rust-lang#212
1 parent 9580af9 commit 97c2f1f

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1717
### Changed
1818
- Use `clang_sys` instead of the internal ffi
1919
- Use `[type; 0]` for the incomplete and dependent sized array
20+
- Don't expand typedefed function parameter types (#212)
2021

2122
### Fixed
2223
- Fix build on OSX

src/parser.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ fn get_abi(cc: CXCallingConv) -> abi::Abi {
157157
fn conv_ptr_ty(ctx: &mut ClangParserCtx, ty: &cx::Type, cursor: &Cursor, layout: Layout) -> il::Type {
158158
let is_const = ty.is_const();
159159
match ty.kind() {
160-
CXTypeKind::Void => {
161-
TPtr(Box::new(TVoid), is_const, layout)
162-
}
163160
CXTypeKind::Unexposed |
164161
CXTypeKind::FunctionProto |
165162
CXTypeKind::FunctionNoProto => {
@@ -176,16 +173,6 @@ fn conv_ptr_ty(ctx: &mut ClangParserCtx, ty: &cx::Type, cursor: &Cursor, layout:
176173
TPtr(Box::new(TVoid), ty.is_const(), layout)
177174
}
178175
}
179-
CXTypeKind::Typedef => {
180-
let decl = ty.declaration();
181-
let def_ty = decl.typedef_type();
182-
if def_ty.kind() == CXTypeKind::FunctionProto ||
183-
def_ty.kind() == CXTypeKind::FunctionNoProto {
184-
TPtr(Box::new(conv_ptr_ty(ctx, &def_ty, cursor, layout)), is_const, layout)
185-
} else {
186-
TPtr(Box::new(conv_ty(ctx, ty, cursor)), is_const, layout)
187-
}
188-
}
189176
_ => TPtr(Box::new(conv_ty(ctx, ty, cursor)), is_const, layout),
190177
}
191178
}

0 commit comments

Comments
 (0)