CVec was removed from stdlib, so use outside copy.

This commit is contained in:
sbidin
2015-03-23 01:56:48 +01:00
parent b07ffcfbfe
commit abbcdd5214
2 changed files with 6 additions and 2 deletions
+1
View File
@@ -14,6 +14,7 @@ name = "sdl2_gfx"
path = "src/sdl2_gfx/lib.rs"
[dependencies]
c_vec = "^1.0.0"
[dependencies.sdl2]
git = "https://github.com/AngryLawyer/rust-sdl2/"
+5 -2
View File
@@ -1,10 +1,13 @@
//! MMX image filters
extern crate c_vec;
use std::mem;
use std::c_vec::CVec;
use std::ptr::Unique;
use libc;
use libc::{size_t, c_void, c_uint, c_int};
use sdl2::SdlResult;
use self::c_vec::CVec;
mod ll {
/* automatically generated by rust-bindgen */
@@ -105,7 +108,7 @@ pub fn mmx_on() {
fn cvec_with_size(sz: uint) -> CVec<u8> {
unsafe {
let p = libc::malloc(sz as size_t) as *mut u8;
CVec::new_with_dtor(p, sz, move || {
CVec::new_with_dtor(Unique::new(p), sz, move |p| {
libc::free(p as *mut c_void)
})
}