Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions crates/c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3140,7 +3140,8 @@ pub fn is_arg_by_pointer(resolve: &Resolve, ty: &Type) -> bool {
}

pub fn to_c_ident(name: &str) -> String {
match name {
let ident = name.to_snake_case();
match ident.as_str() {
// Escape C and C++ keywords.
// Source: https://en.cppreference.com/w/cpp/keyword
"alignas" => "alignas_".into(),
Expand Down Expand Up @@ -3245,6 +3246,6 @@ pub fn to_c_ident(name: &str) -> String {
// variable names for option and result flattening.
"ret" => "ret_".into(),
"err" => "err_".into(),
s => s.to_snake_case(),
_ => ident,
}
}