Skip to main content

luaur_compiler/functions/
cstring_builtin_folding.rs

1use crate::functions::cstring_builtin_folding_alt_b::cstring_c_char_usize;
2use crate::records::constant::Constant;
3use core::ffi::c_char;
4
5#[allow(non_snake_case)]
6pub fn cstring_c_char(v: *const c_char) -> Constant {
7    let mut len = 0;
8    unsafe {
9        while *v.add(len) != 0 {
10            len += 1;
11        }
12    }
13    cstring_c_char_usize(v, len)
14}