Support Vec<c_char>
diff --git a/src/cxx.cc b/src/cxx.cc
index cd72d82..2a8ba97 100644
--- a/src/cxx.cc
+++ b/src/cxx.cc
@@ -379,6 +379,7 @@
#define FOR_EACH_RUST_VEC(MACRO) \
FOR_EACH_NUMERIC(MACRO) \
MACRO(bool, bool) \
+ MACRO(char, char) \
MACRO(string, rust::String)
extern "C" {
diff --git a/src/symbols/rust_vec.rs b/src/symbols/rust_vec.rs
index df6dec6..4f4b6ff 100644
--- a/src/symbols/rust_vec.rs
+++ b/src/symbols/rust_vec.rs
@@ -3,6 +3,7 @@
use alloc::vec::Vec;
use core::mem;
use core::ptr;
+use std::os::raw::c_char;
macro_rules! rust_vec_shims {
($segment:expr, $ty:ty) => {
@@ -74,4 +75,5 @@
rust_vec_shims_for_primitive!(f32);
rust_vec_shims_for_primitive!(f64);
+rust_vec_shims!("char", c_char);
rust_vec_shims!("string", RustString);
diff --git a/syntax/check.rs b/syntax/check.rs
index cdf174c..85db2480 100644
--- a/syntax/check.rs
+++ b/syntax/check.rs
@@ -99,10 +99,10 @@
}
match Atom::from(&ident.rust) {
- None | Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(Usize) | Some(I8)
- | Some(I16) | Some(I32) | Some(I64) | Some(Isize) | Some(F32) | Some(F64)
- | Some(RustString) => return,
- Some(Bool) | Some(Char) => { /* todo */ }
+ None | Some(Char) | Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(Usize)
+ | Some(I8) | Some(I16) | Some(I32) | Some(I64) | Some(Isize) | Some(F32)
+ | Some(F64) | Some(RustString) => return,
+ Some(Bool) => { /* todo */ }
Some(CxxString) => {}
}
}