Skip to content

Commit

Permalink
Make object! macro public (TMP)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jun 11, 2022
1 parent 195508e commit 2842d69
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions objc2-foundation/src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[doc(hidden)]
#[macro_export]
macro_rules! __impl_as_ref_borrow {
($name:ident<$($t:ident $(: $b:ident)?),*>,) => {};
($name:ident<$($t:ident $(: $b:ident)?),*>, $item:ty, $($tail:ty,)*) => {
Expand Down Expand Up @@ -39,7 +41,7 @@ macro_rules! __impl_as_ref_borrow {
}
}

__impl_as_ref_borrow!($name<$($t $(: $b)?),*>, $($tail,)*);
$crate::__impl_as_ref_borrow!($name<$($t $(: $b)?),*>, $($tail,)*);
};
}

Expand All @@ -51,6 +53,7 @@ macro_rules! __impl_as_ref_borrow {
/// and it's instances must have the raw encoding `Encoding::Object` (an
/// example: `NSAutoreleasePool` does not have this). Finally the ownership
/// must be correct for this class.
#[macro_export]
macro_rules! object {
(
$(#[$m:meta])*
Expand Down Expand Up @@ -163,7 +166,7 @@ macro_rules! object {
}
}

__impl_as_ref_borrow!($name<$($t $(: $b)?),*>, $inherits, $($inheritance_rest,)*);
$crate::__impl_as_ref_borrow!($name<$($t $(: $b)?),*>, $inherits, $($inheritance_rest,)*);

// Objective-C equality has approximately the same semantics as Rust
// equality (although less aptly specified).
Expand Down

0 comments on commit 2842d69

Please sign in to comment.