diff options
author | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-03-23 02:31:29 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-03-23 02:32:21 +0100 |
commit | 7f147fe6f145061c4e7b6fa943a64c418369f88b (patch) | |
tree | a5726bcde49005aadcac9bf8f4cf9300b75b5c68 | |
parent | 08b0b5e67a0976368395515e8a9f700e67758a43 (diff) |
gen: Generate rust types for stdint types
-rw-r--r-- | src/gen.rs | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -90,10 +90,20 @@ fn rust_type_id(ctx: &mut GenCtx, name: &str) -> String { "u32" | "f32" | "f64" | "i8" | "i16" | "i32" | "i64" | "Self" | "str" => { - let mut s = "_".to_string(); + let mut s = "_".to_owned(); s.push_str(name); s } + "int8_t" => "i8".to_owned(), + "uint8_t" => "u8".to_owned(), + "int16_t" => "i16".to_owned(), + "uint16_t" => "u16".to_owned(), + "int32_t" => "i32".to_owned(), + "uint32_t" => "u32".to_owned(), + "int64_t" => "i64".to_owned(), + "uint64_t" => "u64".to_owned(), + "size_t" => "usize".to_owned(), + "ssize_t" => "isize".to_owned(), _ => first(rust_id(ctx, name)) } } |