use std::cast::transmute;
use std::cast;
use std::hashmap::{HashMap};
-use std::libc::{c_uint, c_longlong, c_ulonglong};
+use std::libc::{c_uint, c_longlong, c_ulonglong, c_char};
use std::vec;
use syntax::ast::ident;
use syntax::ast_map::{path, path_elt};
None => ()
}
- let sc = do s.with_c_str |buf| {
- llvm::LLVMConstStringInContext(cx.llcx, buf, s.len() as c_uint, False)
+ let sc = do s.as_imm_buf |buf, buflen| {
+ llvm::LLVMConstStringInContext(cx.llcx, buf as *c_char, buflen as c_uint, False)
};
let gsym = token::gensym("str");
Ignore => bcx,
SaveIn(lldest) => {
unsafe {
- let bytes = str_lit.len(); // count null-terminator too
+ let bytes = str_lit.len();
let llbytes = C_uint(bcx.ccx(), bytes);
let llcstr = C_cstr(bcx.ccx(), str_lit);
let llcstr = llvm::LLVMConstPointerCast(llcstr, Type::i8p().to_ref());