From 159def9e9b853407381a7121e86bdda872a40d40 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 17 Oct 2017 12:50:15 +0200 Subject: [PATCH] Mark void pointers as gpointer Otherwise the ABI is not properly respected as for some reason, mem::size_of::() returns 1 on a 64bits system. In the case of GstVideoDecoder(Class), the ABI mistmatches because of the `void * padding[14]` field which is translated to `pub padding: [c_void; 14]` which size was 14(bytes) instead of 112 (on 64bits systems). --- src/codegen/sys/ffi_type.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen/sys/ffi_type.rs b/src/codegen/sys/ffi_type.rs index 679c56eb4..720ffbc3d 100644 --- a/src/codegen/sys/ffi_type.rs +++ b/src/codegen/sys/ffi_type.rs @@ -92,7 +92,7 @@ fn ffi_inner(env: &Env, tid: library::TypeId, mut inner: String) -> Result { Type => "GType", Pointer => { match &inner[..] { - "void" => "c_void", + "void" => "gpointer", "tm" => return Err(TypeError::Unimplemented(inner)), //TODO: try use time:Tm _ => &*inner, }