From a9ff6570816577772d913912877e6d65c037496e Mon Sep 17 00:00:00 2001 From: Pavlos1 Date: Sat, 13 Jun 2015 20:30:47 +1000 Subject: [PATCH 1/2] Fix QrsVariant enum This enum does not match the one in ext/libqmlrswrapper/libqmlrswrapper.cpp (The rust version does not have a Bool slot). As a consequence, the enumeration values are different and hence QrsVariant::String has different values in rust and C. This caused a bug where the strings from QML were not recognised as strings by the Rust code (ffi::qmlrs_variant_get_type(var) != QrsVariantType::String). This commit seems to fix the issue, at least in regards to my own project. --- src/ffi.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ffi.rs b/src/ffi.rs index bc0ebcd..47417a4 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -13,6 +13,7 @@ pub enum QVariantList {} pub enum QrsVariantType { Invalid = 0, Int64, + Bool, String } From bdcf5e22fe108491227bb624005de310f0871f33 Mon Sep 17 00:00:00 2001 From: Pavlos1 Date: Sat, 13 Jun 2015 20:34:37 +1000 Subject: [PATCH 2/2] Added #![feature(custom_attribute)] For some reason this branch does not compile without it. --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 10fb0f1..3a4d852 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +#![feature(custom_attribute)] extern crate libc; use libc::{c_char, c_int, c_uint, c_void};