diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-07-06 05:01:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 05:01:48 -0400 |
commit | 6a480ffeb8d30a2ea58dc7e605a0274ca29e28cb (patch) | |
tree | 767f3830c0a63fe0844ea293c7fcddb37c70d477 /src/codegen/mod.rs | |
parent | c197acf847c4ea6012061c1246668514059c34ae (diff) | |
parent | b3e41a2924bb60e0a308bd2d35c8b9c0126a7249 (diff) |
Auto merge of #1346 - emilio:wchar, r=fitzgen
ir: Don't assume wchar is 2 bytes.
Fixes #1345
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r-- | src/codegen/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 026e9475..2a0891d9 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -2978,6 +2978,12 @@ impl TryToRustTy for Type { IntKind::ULong => Ok(raw_type(ctx, "c_ulong")), IntKind::LongLong => Ok(raw_type(ctx, "c_longlong")), IntKind::ULongLong => Ok(raw_type(ctx, "c_ulonglong")), + IntKind::WChar { size } => { + let ty = Layout::known_type_for_size(size) + .expect("Non-representable wchar_t?"); + let ident = ctx.rust_ident_raw(ty); + Ok(quote! { #ident }) + }, IntKind::I8 => Ok(quote! { i8 }), IntKind::U8 => Ok(quote! { u8 }), |