Skip to content

Commit

Permalink
rustc: Add Type::c_int()
Browse files Browse the repository at this point in the history
Add c_int for use in the compiler,
assuming i32 for all targets as in libc.
  • Loading branch information
dkl committed Sep 28, 2017
1 parent d887369 commit 6c9a4ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_trans/type_.rs
Expand Up @@ -140,6 +140,10 @@ impl Type {
}
}

pub fn c_int(ccx: &CrateContext) -> Type {
Type::i32(ccx)
}

pub fn int_from_ty(ccx: &CrateContext, t: ast::IntTy) -> Type {
match t {
ast::IntTy::Is => ccx.isize_ty(),
Expand Down

0 comments on commit 6c9a4ba

Please sign in to comment.