From 9ff906eb8ee08f0ab0568454036f290bbfb2b4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 20 Nov 2018 01:47:58 +0200 Subject: [PATCH] Declare correct major/minor plugin versions based on bindings configuration Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugin-rs/issues/37 --- gstreamer/src/subclass/plugin.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gstreamer/src/subclass/plugin.rs b/gstreamer/src/subclass/plugin.rs index 6aec19e98..3821e0547 100644 --- a/gstreamer/src/subclass/plugin.rs +++ b/gstreamer/src/subclass/plugin.rs @@ -6,6 +6,19 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +pub const MAJOR_VERSION: i32 = 1; + +#[cfg(not(feature = "v1_10"))] +pub const MINOR_VERSION: i32 = 8; +#[cfg(all(feature = "v1_10", not(feature = "v1_12")))] +pub const MINOR_VERSION: i32 = 10; +#[cfg(all(feature = "v1_12", not(feature = "v1_14")))] +pub const MINOR_VERSION: i32 = 12; +#[cfg(all(feature = "v1_14", not(feature = "v1_16")))] +pub const MINOR_VERSION: i32 = 14; +#[cfg(all(feature = "v1_16", not(feature = "v1_18")))] +pub const MINOR_VERSION: i32 = 16; + #[macro_export] macro_rules! gst_plugin_define( ($name:expr, $description:expr, $plugin_init:ident, @@ -14,8 +27,8 @@ macro_rules! gst_plugin_define( pub mod plugin_desc { use $crate::glib::translate::{from_glib_borrow, ToGlib, from_glib}; - const MAJOR_VERSION: i32 = 1; - const MINOR_VERSION: i32 = 8; + const MAJOR_VERSION: i32 = $crate::subclass::MAJOR_VERSION; + const MINOR_VERSION: i32 = $crate::subclass::MINOR_VERSION; // Not using c_char here because it requires the libc crate #[allow(non_camel_case_types)]