gstreamer: error: Allow using variable expansion in loggable_error! macro

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/490

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1332>
This commit is contained in:
Sebastian Dröge 2023-10-26 13:54:32 +03:00 committed by GStreamer Marge Bot
parent bd9b1d6e38
commit bd4122e334

View file

@ -62,12 +62,6 @@ impl ErrorMessage {
#[macro_export] #[macro_export]
macro_rules! loggable_error( macro_rules! loggable_error(
// Plain strings
($cat:expr, $msg:expr) => {
$crate::LoggableError::new($cat.clone(), $crate::glib::bool_error!($msg))
};
// Format strings
($cat:expr, $($msg:tt)*) => { { ($cat:expr, $($msg:tt)*) => { {
$crate::LoggableError::new($cat.clone(), $crate::glib::bool_error!($($msg)*)) $crate::LoggableError::new($cat.clone(), $crate::glib::bool_error!($($msg)*))
}}; }};
@ -75,13 +69,6 @@ macro_rules! loggable_error(
#[macro_export] #[macro_export]
macro_rules! result_from_gboolean( macro_rules! result_from_gboolean(
// Plain strings
($ffi_bool:expr, $cat:expr, $msg:expr) => {
$crate::glib::result_from_gboolean!($ffi_bool, $msg)
.map_err(|bool_err| $crate::LoggableError::new($cat.clone(), bool_err))
};
// Format strings
($ffi_bool:expr, $cat:expr, $($msg:tt)*) => { { ($ffi_bool:expr, $cat:expr, $($msg:tt)*) => { {
$crate::glib::result_from_gboolean!($ffi_bool, $($msg)*) $crate::glib::result_from_gboolean!($ffi_bool, $($msg)*)
.map_err(|bool_err| $crate::LoggableError::new($cat.clone(), bool_err)) .map_err(|bool_err| $crate::LoggableError::new($cat.clone(), bool_err))