Use ctypes in native function declarations

This commit is contained in:
Haitao Li 2012-01-16 18:21:01 +08:00
parent f03eb96f39
commit dde41869ce
17 changed files with 252 additions and 223 deletions

View file

@ -221,7 +221,7 @@ fn get_metadata_section(sess: session::session,
let name = unsafe { str::from_cstr(name_buf) };
if str::eq(name, sess.targ_cfg.target_strs.meta_sect_name) {
let cbuf = llvm::LLVMGetSectionContents(si.llsi);
let csz = llvm::LLVMGetSectionSize(si.llsi);
let csz = llvm::LLVMGetSectionSize(si.llsi) as uint;
unsafe {
let cvbuf: *u8 = unsafe::reinterpret_cast(cbuf);
ret option::some::<@[u8]>(@vec::unsafe::from_buf(cvbuf, csz));