File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1983,11 +1983,11 @@ bool Converter::VisitStringLiteral(clang::StringLiteral *expr) {
19831983 uint64_t pad = arr_size > expr->getString ().size ()
19841984 ? arr_size - expr->getString ().size ()
19851985 : 0 ;
1986- StrCat (std::format (" libcc2rs::char_array( b{})" ,
1986+ StrCat (std::format (" unsafe {{ ::std::mem::transmute(* b{}) }} " ,
19871987 GetEscapedStringLiteral (expr, pad)));
19881988 return false ;
19891989 }
1990- StrCat (std::format (" libcc2rs::char_array( b{})" ,
1990+ StrCat (std::format (" unsafe {{ ::std::mem::transmute(* b{}) }} " ,
19911991 GetEscapedStringLiteral (expr, 1 )));
19921992 return false ;
19931993 }
Original file line number Diff line number Diff line change @@ -35,13 +35,3 @@ mod va_args;
3535pub use va_args:: * ;
3636
3737pub use libcc2rs_macros:: { goto, goto_block, switch} ;
38-
39- pub const fn char_array < const N : usize > ( s : & [ u8 ; N ] ) -> [ core:: ffi:: c_char ; N ] {
40- let mut out = [ 0 as core:: ffi:: c_char ; N ] ;
41- let mut i = 0 ;
42- while i < N {
43- out[ i] = s[ i] as core:: ffi:: c_char ;
44- i += 1 ;
45- }
46- out
47- }
You can’t perform that action at this time.
0 commit comments