Skip to content

Commit

Permalink
fix cxx.cc MACRO; support for CxxString.
Browse files Browse the repository at this point in the history
  • Loading branch information
makai410 committed Sep 17, 2024
1 parent 7067a6c commit 827fd85
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/cxx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -840,16 +840,19 @@ static_assert(sizeof(std::string) <= kMaxExpectedWordsInString * sizeof(void *),

#define FOR_EACH_TRIVIAL_STD_VECTOR_PTR(MACRO) \
FOR_EACH_NUMERIC_WITH_PTR_PREFIX(MACRO) \
MACRO(string, usize, std::size_t) \
MACRO(string, isize, rust::isize)
MACRO(ptrc, usize, std::size_t) \
MACRO(ptrc, isize, rust::isize) \
MACRO(ptrm, usize, std::size_t) \
MACRO(ptrm, isize, rust::isize)

#define FOR_EACH_STD_VECTOR(MACRO) \
FOR_EACH_TRIVIAL_STD_VECTOR(MACRO) \
MACRO(string, std::string)

#define FOR_EACH_STD_VECTOR_PTR(MACRO) \
FOR_EACH_TRIVIAL_STD_VECTOR_PTR(MACRO) \
MACRO(string, string, std::string)
MACRO(ptrc, string, std::string) \
MACRO(ptrm, string, std::string)

#define FOR_EACH_RUST_VEC(MACRO) \
FOR_EACH_NUMERIC(MACRO) \
Expand Down
5 changes: 4 additions & 1 deletion src/cxx_vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -862,4 +862,7 @@ impl_ptr_vector_element_for_primitive!(ptrm, i32);
impl_ptr_vector_element_for_primitive!(ptrm, i64);
impl_ptr_vector_element_for_primitive!(ptrm, isize);
impl_ptr_vector_element_for_primitive!(ptrm, f32);
impl_ptr_vector_element_for_primitive!(ptrm, f64);
impl_ptr_vector_element_for_primitive!(ptrm, f64);

impl_ptrc_vector_element!(opaque, "string", "CxxString", CxxString);
impl_ptrm_vector_element!(opaque, "string", "CxxString", CxxString);

0 comments on commit 827fd85

Please sign in to comment.