diff --git a/src/lib.rs b/src/lib.rs index f476590..e1dae8e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1263,7 +1263,14 @@ impl<'a> Generator<'a> { let ret = match decl.output { ast::FunctionRetTy::None(..) | ast::FunctionRetTy::Default(..) => "void".to_string(), - ast::FunctionRetTy::Ty(ref t) => self.ty2name(t, false), + ast::FunctionRetTy::Ty(ref t) => { + match t.node { + ast::TyKind::Tup(ref t) if t.len() == 0 => { + "void".to_string() + } + _ => self.ty2name(t, false), + } + } }; (ret, args, decl.variadic) } diff --git a/testcrate/src/t1.rs b/testcrate/src/t1.rs index 0e48f0b..b43b4ed 100644 --- a/testcrate/src/t1.rs +++ b/testcrate/src/t1.rs @@ -34,5 +34,5 @@ extern { pub fn T1e(a: c_uint, b: *const T1Bar); #[link_name = "T1f"] - pub fn f(); + pub fn f() -> (); }