Skip to content

Commit

Permalink
Further changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gupnik committed Jan 23, 2025
1 parent 72f3cbb commit 163f578
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions codegen-v2/src/codegen/cpp/code_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ pub struct TWArg {

fn convert_rust_type_to_cpp(ty: &str) -> String {
match ty.trim() {
s if s.starts_with("* const") => format!("{} *_Nonnull", &s[8..]),
s if s.starts_with("* mut") => format!("{} *_Nullable", &s[6..]),
s if s.starts_with("* const ") => {
format!("{} *_Nonnull", s.strip_prefix("* const ").expect("Checked"))
}
s if s.starts_with("* mut ") => {
format!("{} *_Nullable", s.strip_prefix("* mut ").expect("Checked"))
}
"bool" => "bool".to_string(),
_ => ty.to_string(),
}
Expand Down

0 comments on commit 163f578

Please sign in to comment.