mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 17:41:05 +00:00
Fully qualify inner macros for exported macros...
... otherwise they can't be resolved in dependent crates compiled for edition 2018.
This commit is contained in:
parent
c00bceb123
commit
eb87563479
4 changed files with 28 additions and 28 deletions
|
@ -118,13 +118,13 @@ macro_rules! gst_loggable_error(
|
||||||
macro_rules! gst_result_from_gboolean(
|
macro_rules! gst_result_from_gboolean(
|
||||||
// Plain strings
|
// Plain strings
|
||||||
($gst_sys_bool:expr, $cat:expr, $msg:expr) => {
|
($gst_sys_bool:expr, $cat:expr, $msg:expr) => {
|
||||||
glib_result_from_gboolean!($gst_sys_bool, $msg)
|
$crate::glib::glib_result_from_gboolean!($gst_sys_bool, $msg)
|
||||||
.map_err(|bool_err| $crate::LoggableError::new($cat.clone(), bool_err))
|
.map_err(|bool_err| $crate::LoggableError::new($cat.clone(), bool_err))
|
||||||
};
|
};
|
||||||
|
|
||||||
// Format strings
|
// Format strings
|
||||||
($gst_sys_bool:expr, $cat:expr, $($msg:tt)*) => { {
|
($gst_sys_bool:expr, $cat:expr, $($msg:tt)*) => { {
|
||||||
glib_result_from_gboolean!($gst_sys_bool, $($msg)*)
|
$crate::glib::glib_result_from_gboolean!($gst_sys_bool, $($msg)*)
|
||||||
.map_err(|bool_err| $crate::LoggableError::new($cat.clone(), bool_err))
|
.map_err(|bool_err| $crate::LoggableError::new($cat.clone(), bool_err))
|
||||||
}};
|
}};
|
||||||
);
|
);
|
||||||
|
|
|
@ -219,80 +219,80 @@ declare_debug_category_from_name!(CAT_CONTEXT, "GST_CONTEXT");
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! gst_error(
|
macro_rules! gst_error(
|
||||||
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Error, obj: $obj, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Error, obj: $obj, $($args)*)
|
||||||
}};
|
}};
|
||||||
($cat:expr, $($args:tt)*) => { {
|
($cat:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Error, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Error, $($args)*)
|
||||||
}};
|
}};
|
||||||
);
|
);
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! gst_warning(
|
macro_rules! gst_warning(
|
||||||
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Warning, obj: $obj, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Warning, obj: $obj, $($args)*)
|
||||||
}};
|
}};
|
||||||
($cat:expr, $($args:tt)*) => { {
|
($cat:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Warning, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Warning, $($args)*)
|
||||||
}};
|
}};
|
||||||
);
|
);
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! gst_fixme(
|
macro_rules! gst_fixme(
|
||||||
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Fixme, obj: $obj, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Fixme, obj: $obj, $($args)*)
|
||||||
}};
|
}};
|
||||||
($cat:expr, $($args:tt)*) => { {
|
($cat:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Fixme, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Fixme, $($args)*)
|
||||||
}};
|
}};
|
||||||
);
|
);
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! gst_info(
|
macro_rules! gst_info(
|
||||||
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Info, obj: $obj, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Info, obj: $obj, $($args)*)
|
||||||
}};
|
}};
|
||||||
($cat:expr, $($args:tt)*) => { {
|
($cat:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Info, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Info, $($args)*)
|
||||||
}};
|
}};
|
||||||
);
|
);
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! gst_debug(
|
macro_rules! gst_debug(
|
||||||
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Debug, obj: $obj, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Debug, obj: $obj, $($args)*)
|
||||||
}};
|
}};
|
||||||
($cat:expr, $($args:tt)*) => { {
|
($cat:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Debug, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Debug, $($args)*)
|
||||||
}};
|
}};
|
||||||
);
|
);
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! gst_log(
|
macro_rules! gst_log(
|
||||||
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Log, obj: $obj, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Log, obj: $obj, $($args)*)
|
||||||
}};
|
}};
|
||||||
($cat:expr, $($args:tt)*) => { {
|
($cat:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Log, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Log, $($args)*)
|
||||||
}};
|
}};
|
||||||
);
|
);
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! gst_trace(
|
macro_rules! gst_trace(
|
||||||
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Trace, obj: $obj, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Trace, obj: $obj, $($args)*)
|
||||||
}};
|
}};
|
||||||
($cat:expr, $($args:tt)*) => { {
|
($cat:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Trace, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Trace, $($args)*)
|
||||||
}};
|
}};
|
||||||
);
|
);
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! gst_memdump(
|
macro_rules! gst_memdump(
|
||||||
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Memdump, obj: $obj, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Memdump, obj: $obj, $($args)*)
|
||||||
}};
|
}};
|
||||||
($cat:expr, $($args:tt)*) => { {
|
($cat:expr, $($args:tt)*) => { {
|
||||||
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Memdump, $($args)*)
|
$crate::gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Memdump, $($args)*)
|
||||||
}};
|
}};
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ macro_rules! gst_plugin_define(
|
||||||
|
|
||||||
pub fn plugin_register_static() -> Result<(), glib::BoolError> {
|
pub fn plugin_register_static() -> Result<(), glib::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
glib_result_from_gboolean!(
|
$crate::glib::glib_result_from_gboolean!(
|
||||||
$crate::gst_sys::gst_plugin_register_static(
|
$crate::gst_sys::gst_plugin_register_static(
|
||||||
$crate::subclass::plugin::MAJOR_VERSION,
|
$crate::subclass::plugin::MAJOR_VERSION,
|
||||||
$crate::subclass::plugin::MINOR_VERSION,
|
$crate::subclass::plugin::MINOR_VERSION,
|
||||||
|
@ -73,18 +73,18 @@ macro_rules! gst_plugin_define(
|
||||||
Ok(_) => $crate::glib_sys::GTRUE,
|
Ok(_) => $crate::glib_sys::GTRUE,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let cat = $crate::DebugCategory::get("GST_PLUGIN_LOADING").unwrap();
|
let cat = $crate::DebugCategory::get("GST_PLUGIN_LOADING").unwrap();
|
||||||
gst_error!(cat, "Failed to register plugin: {}", err);
|
$crate::gst_error!(cat, "Failed to register plugin: {}", err);
|
||||||
$crate::glib_sys::GFALSE
|
$crate::glib_sys::GFALSE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let cat = $crate::DebugCategory::get("GST_PLUGIN_LOADING").unwrap();
|
let cat = $crate::DebugCategory::get("GST_PLUGIN_LOADING").unwrap();
|
||||||
if let Some(cause) = err.downcast_ref::<&str>() {
|
if let Some(cause) = err.downcast_ref::<&str>() {
|
||||||
gst_error!(cat, "Failed to initialize plugin due to panic: {}", cause);
|
$crate::gst_error!(cat, "Failed to initialize plugin due to panic: {}", cause);
|
||||||
} else if let Some(cause) = err.downcast_ref::<String>() {
|
} else if let Some(cause) = err.downcast_ref::<String>() {
|
||||||
gst_error!(cat, "Failed to initialize plugin due to panic: {}", cause);
|
$crate::gst_error!(cat, "Failed to initialize plugin due to panic: {}", cause);
|
||||||
} else {
|
} else {
|
||||||
gst_error!(cat, "Failed to initialize plugin due to panic");
|
$crate::gst_error!(cat, "Failed to initialize plugin due to panic");
|
||||||
}
|
}
|
||||||
|
|
||||||
$crate::glib_sys::GFALSE
|
$crate::glib_sys::GFALSE
|
||||||
|
|
|
@ -42,7 +42,7 @@ macro_rules! gst_plugin_define(
|
||||||
|
|
||||||
pub fn plugin_register_static() -> Result<(), glib::BoolError> {
|
pub fn plugin_register_static() -> Result<(), glib::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
glib_result_from_gboolean!(
|
$crate::glib::glib_result_from_gboolean!(
|
||||||
$crate::gst_sys::gst_plugin_register_static(
|
$crate::gst_sys::gst_plugin_register_static(
|
||||||
$crate::subclass::plugin::MAJOR_VERSION,
|
$crate::subclass::plugin::MAJOR_VERSION,
|
||||||
$crate::subclass::plugin::MINOR_VERSION,
|
$crate::subclass::plugin::MINOR_VERSION,
|
||||||
|
@ -81,18 +81,18 @@ macro_rules! gst_plugin_define(
|
||||||
Ok(_) => $crate::glib_sys::GTRUE,
|
Ok(_) => $crate::glib_sys::GTRUE,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let cat = $crate::DebugCategory::get("GST_PLUGIN_LOADING").unwrap();
|
let cat = $crate::DebugCategory::get("GST_PLUGIN_LOADING").unwrap();
|
||||||
gst_error!(cat, "Failed to register plugin: {}", err);
|
$crate::gst_error!(cat, "Failed to register plugin: {}", err);
|
||||||
$crate::glib_sys::GFALSE
|
$crate::glib_sys::GFALSE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let cat = $crate::DebugCategory::get("GST_PLUGIN_LOADING").unwrap();
|
let cat = $crate::DebugCategory::get("GST_PLUGIN_LOADING").unwrap();
|
||||||
if let Some(cause) = err.downcast_ref::<&str>() {
|
if let Some(cause) = err.downcast_ref::<&str>() {
|
||||||
gst_error!(cat, "Failed to initialize plugin due to panic: {}", cause);
|
$crate::gst_error!(cat, "Failed to initialize plugin due to panic: {}", cause);
|
||||||
} else if let Some(cause) = err.downcast_ref::<String>() {
|
} else if let Some(cause) = err.downcast_ref::<String>() {
|
||||||
gst_error!(cat, "Failed to initialize plugin due to panic: {}", cause);
|
$crate::gst_error!(cat, "Failed to initialize plugin due to panic: {}", cause);
|
||||||
} else {
|
} else {
|
||||||
gst_error!(cat, "Failed to initialize plugin due to panic");
|
$crate::gst_error!(cat, "Failed to initialize plugin due to panic");
|
||||||
}
|
}
|
||||||
|
|
||||||
$crate::glib_sys::GFALSE
|
$crate::glib_sys::GFALSE
|
||||||
|
|
Loading…
Reference in a new issue