Fix linux build

This commit is contained in:
Brian Anderson 2012-10-04 18:20:57 -07:00
parent 01dbcf5772
commit 0a07bd62de
4 changed files with 6 additions and 5 deletions

@ -1 +1 @@
Subproject commit c201bc1f2c6cb38d7a81647516f3f55892c8d89d Subproject commit 5b57a6efee711ed399d9c0d158a86857d0b96060

View file

@ -60,7 +60,7 @@ pub mod native {
pub fn create_native_lib() -> NativeFontCache { pub fn create_native_lib() -> NativeFontCache {
let lib: FT_Library = null(); let lib: FT_Library = null();
let res = FT_Init_FreeType(addr_of(lib)); let res = FT_Init_FreeType(addr_of(&lib));
// FIXME: error handling // FIXME: error handling
assert res == 0 as FT_Error; assert res == 0 as FT_Error;
return lib; return lib;

View file

@ -1,3 +1,4 @@
#[legacy_exports];
export FreeTypeNativeFont, with_test_native_font, create; export FreeTypeNativeFont, with_test_native_font, create;
use vec_as_buf = vec::as_imm_buf; use vec_as_buf = vec::as_imm_buf;
@ -89,7 +90,7 @@ pub fn create(lib: &FT_Library, buf: @~[u8]) -> Result<FreeTypeNativeFont, ()> {
let face: FT_Face = null(); let face: FT_Face = null();
return vec_as_buf(*buf, |cbuf, _len| { return vec_as_buf(*buf, |cbuf, _len| {
if FT_New_Memory_Face(*lib, cbuf, (*buf).len() as FT_Long, if FT_New_Memory_Face(*lib, cbuf, (*buf).len() as FT_Long,
0 as FT_Long, addr_of(face)).succeeded() { 0 as FT_Long, addr_of(&face)).succeeded() {
// FIXME: These values are placeholders // FIXME: These values are placeholders
let res = FT_Set_Char_Size(face, 0, 20*64, 0, 72); let res = FT_Set_Char_Size(face, 0, 20*64, 0, 72);
if !res.succeeded() { fail ~"unable to set font char size" } if !res.succeeded() { fail ~"unable to set font char size" }
@ -121,7 +122,7 @@ fn with_test_native_font(f: fn@(nf: &NativeFont)) {
fn with_lib(f: fn@((&FT_Library))) { fn with_lib(f: fn@((&FT_Library))) {
let lib: FT_Library = null(); let lib: FT_Library = null();
assert FT_Init_FreeType(addr_of(lib)).succeeded(); assert FT_Init_FreeType(addr_of(&lib)).succeeded();
f(&lib); f(&lib);
FT_Done_FreeType(lib); FT_Done_FreeType(lib);
} }

@ -1 +1 @@
Subproject commit 01e76b4ec3eaf5fe2e29513667e601bb2a3c70b5 Subproject commit 26ddabc20216428b66e182795dbcd5782d0e9d4f